question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Openjdk is being treated as invalid JDK on vscode for linux

See original GitHub issue

Issue 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:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:28 (3 by maintainers)

github_iconTop GitHub Comments

39reactions
Katonacommented, Dec 29, 2019

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

8reactions
tarun0commented, Dec 17, 2019

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)

drwxr-xr-x 7 tarun root 4096 Dec 16 15:06 . drwxr-xr-x 3 root root 4096 Dec 16 15:06 … drwxr-xr-x 2 tarun root 4096 Dec 16 15:06 bin drwxr-xr-x 4 tarun root 4096 Dec 12 15:11 conf lrwxrwxrwx 1 tarun root 42 Jul 18 23:51 docs -> …/…/…/share/doc/openjdk-11-jre-headless drwxr-xr-x 72 tarun root 4096 Dec 12 15:11 legal drwxr-xr-x 6 tarun root 4096 Dec 16 15:06 lib drwxr-xr-x 4 tarun root 4096 Dec 12 15:11 man -rw-r–r-- 1 tarun root 1161 Jul 18 23:51 release

Below is the complete error (doesn’t point to jdk) Screenshot from 2019-12-17 11-14-35

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found