I have already found many answers and also tried. Unfortunately, none worked for me.
I am trying to install Visual Studio Code on Ubuntu 20.04 (Focal Fossa). And so far it always went very smoothly. Unfortunately, this time not.
My approach was:
$JAVA_HOME, $PATH:
When it didn't work, I put it in ~/.config/Code/User/settings.json (a different path than in $JAVA_HOME, because I tried something but that didn't work either). After all these operations, Visual Studio Code still didn't regest it.
File settings.json:
Why not? Did I forget something?
I don't know why, but it suddenly works. I installed Java one more time and now it works. Maybe something went wrong with the first Java installation.