Repository navigation
|
How to set the java path? I already set my JAVA_HOME but it doesn't work (it still use default system path). |
Replies: 1 comment
|
Hi @ardikars, neotest-java does not use So the binary path it uses is whatever JDK JDTLS has configured for your project, not your shell's The path in your error (
If you share your JDTLS configuration I can help narrow it down further. |
Hi @ardikars,
neotest-java does not use
JAVA_HOMEdirectly. Instead, it resolves thejava/javapbinaries by querying JDTLS (the Java language server) at runtime via thejava.project.getSettingsLSP command, specifically reading theorg.eclipse.jdt.ls.core.vm.locationsetting.So the binary path it uses is whatever JDK JDTLS has configured for your project, not your shell's
JAVA_HOME.The path in your error (
/usr/lib/jvm/java-21-openjdk/bin/javap) looks like it was reported correctly by JDTLS — the issue is that the binary doesn't exist at that path on your system. A few things to check:Is the JDK actually installed at that path? Run
ls /usr/lib/jvm/java-21-openjdk/bin/javapto verify. …