visual-studio-codejava-11

Visual Studio Code does not accept the $JAVA_HOME Ubuntu 20.04


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:

  1. I installed Visual Studio Code
  2. I installed the Java JDK
  3. I added it to the home (echo $JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64) and the Path(echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-11-openjdk-amd64/bin) variables

$JAVA_HOME, $PATH:

Enter image description here

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:

Enter image description here

Why not? Did I forget something?


Solution

  • 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.