Openjdk is being treated as invalid JDK on vscode for linux
See original GitHub issueIssue Type: Bug
The following error is received on Configure Java Runtime Extension Page of the Language Support for Java Extension:
This path is not pointing to a JDK.
But java commands are working alright in the terminal.
echo $JAVA_HOME
gives /usr/share/java/jdk-11.0.4
and java --version
produces this output:
openjdk 11.0.4 2019-07-16 OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu219.04) OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu219.04, mixed mode, sharing)
Extension version: 0.50.0 VS Code version: Code 1.39.1 OS version: Linux x64 5.0.0-31-generic snap
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:28 (3 by maintainers)
Top Results From Across the Web
how to set JDK in UBUNTU-20.04 using VSCODE?
You should set JAVA_HOME and Add JAVA bin directory to the PATH variable on local machine.
Read more >Java JDK isn't recognized by VS Code - Ask Ubuntu
I wanted to use OracleJDK instead of OpenJDK in VSCode by default. This answer helped me. Only difference is I needed to remove...
Read more >Building the JDK - OpenJDK
If the boot JDK is not automatically detected, or the wrong JDK is picked, use --with-boot-jdk to point to the JDK to use....
Read more >Toolchains for JVM projects - Gradle User Manual
Gradle chooses a JRE/JDK matching the requirements of the build (in this case a JVM supporting Java 11). If no matching JVM is...
Read more >Java in Visual Studio Code
For a quick walkthrough of editing, running, and debugging a Java program with Visual Studio Code, use the Java Getting Started Tutorial button...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @tarun0,
I had a similar issue on Ubuntu 19.10. Installing
openjdk-11-jdk
explicitly fixed it. The directory/usr/lib/jvm/java-11-openjdk-amd64/
contained a jre before installing the jdk.Gabor
Same issue. OS: Ubuntu 18.04.3 LTS
ls -la /usr/lib/jvm/java-11-openjdk-amd64
gives following output (after changing the owner to tarun from root but even that didn’t solve)Below is the complete error (doesn’t point to jdk)