Vscode-java: Java runtime (JDK, not JRE) could not be located - but it is installed with sdkman

Created on 1 Aug 2019  路  6Comments  路  Source: redhat-developer/vscode-java

I am using sdkman to manage my sdk's including java

The extension does not seem to acknowledge my java sdk, even though the sdk should be present

`sdk current java
Using java version 8.0.212-zulu

echo $JAVA_HOME
/home/USER/.sdkman/candidates/java/current

ls /home/USER/.sdkman/candidates/java/current
ASSEMBLY_EXCEPTION
DISCLAIMER LICENSE
sample
bin
include
man
src.zip
CLASSPATH_EXCEPTION_NOTE
jre
readme.txt
THIRD_PARTY_README
demo
lib
release
Welcome.html
`

What does it look for?

Environment
  • Operating System: Ubuntu 19.04
  • JDK version: 8.0.212
  • Visual Studio Code version: 1.36.1
  • Java extension version: 0.47.0
Steps To Reproduce
  1. [step 1] Install jdk using sdkman
  2. [step 2] Install extension

[attach a sample project reproducing the error]
[attach logs](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#enable-logging)

Current Result
Expected Result
Additional Informations

Most helpful comment

try to set "java.home":"/home/USER/.sdkman/candidates/java/current" in vscode's settings.json

All 6 comments

Did you install vscode with flatpack?

I installed vscode using the "Ubuntu software" GUI - i am not sure if that is using flatpack under the hood

try to set "java.home":"/home/USER/.sdkman/candidates/java/current" in vscode's settings.json

Yes, that worked

Funny that vscode does not pick up the $JAVA_HOME - is that because its a "sandboxed" installation?

most likely yes

someone found a solution? :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BuZZ-dEE picture BuZZ-dEE  路  4Comments

gorkem picture gorkem  路  4Comments

marlinla picture marlinla  路  3Comments

jcjolley picture jcjolley  路  3Comments

ronniehicks picture ronniehicks  路  3Comments