vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

JAVA_HOME is not pointing to a JDK.

Open phhoef opened this issue 7 years ago • 31 comments

[provide a description of the issue]

Environment
  • Operating System: macOS Mojave

  • JDK version: OpenJDK 11.4

  • Visual Studio Code version: 1.38.1

  • Java extension version: 0.48.0

Steps To Reproduce
  1. Opening Java Project
Current Result

After opening a Java project, the configure window pops up and shows, that the JAVA_HOME is set, but it's not pointing to a JDK. Bildschirmfoto 2019-09-16 um 14 41 50

The JAVA_HOME path is correctly set.

Expected Result

JDK should be found.

phhoef avatar Sep 16 '19 12:09 phhoef

@gablex I've never seen messages like "[running] cd ... ", and this extension doesn't call javac directly to compile your project. I guess you are talking about other extensions.

Just FYI, I use Language suport for Java for editing, and Debugger for Java to run/debug.

Eskibear avatar Jun 17 '20 10:06 Eskibear

@Eskibear I agree. I have uninstalled all java plugins and installed java plugin pack only and now works

sh-5.0$ /home/admin/Downloads/Programs/jdk11/bin/java -Dfile.encoding=UTF-8 @/tmp/cp_8wzwvixrylq96snesdedrppha.argfile org.acme.martin.QuickStart Hello, World. Thank all.

gablex avatar Jun 17 '20 13:06 gablex

i have the same problem on windows10 19042.423, i hava try adopt jdk 11 and oracle jdk 11, all the same problem.

RonaldinhoL avatar Aug 21 '20 05:08 RonaldinhoL

javahome As quick solution, just edit your vscode setting.json and pointing directly to java_home (eg: add "java.home": "C:\\java\\jdk\\java-11-openjdk-11.0.8-2", ). Please refer attached picture, saved it and vscode will ask to restart. After restart, should be no more same issue. I hope this will help.

RobbiNespu avatar Aug 26 '20 02:08 RobbiNespu

Got the same error on Linux Debian 10.5 (buster). I realized that if I was launching VSC by the application itself, it was doing this error, while if I launch VSC through the terminal, all's good. Maybe user's settings.

NoxFly avatar Oct 06 '20 08:10 NoxFly

try cd your path in the terminal, if it fails, maybe the character format is wrong. then you could write the full path by keyboard, not Copy and Paste.

lovexbma avatar Oct 26 '20 15:10 lovexbma

@gablex Try to install java-11-openjdk-devel. Thats work for me.

fensefernando avatar Jun 30 '21 21:06 fensefernando

See https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements#setting-the-jdk

We have already embedd JRE per platform since v1.2.0. No need to configure java home for language server now. Shall we close this one?

Eskibear avatar Jun 02 '22 05:06 Eskibear

See https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements#setting-the-jdk

We have already embedd JRE per platform since v1.2.0. No need to configure java home for language server now. Shall we close this one?

Yes, this should be closed

gablex avatar Jun 02 '22 06:06 gablex

Closing it since Java extension already embedded a JRE and no need to configure Java home for language server.

testforstephen avatar Feb 13 '23 05:02 testforstephen

For me at least, java is not embeded and if I don't configure it or even if I configure it correctly, it fails and show the popup, can't to anything to remove the popup. The easy configuration window refuses to open.

Guarmanda avatar Oct 15 '24 09:10 Guarmanda