vscode-gradle
vscode-gradle copied to clipboard
Setting up Java without java.home
Is your feature request related to a problem? Please describe.
The Gradle language server refuses to start on a project with the error message: There is no valid JAVA_HOME
setting to launch Gradle Language Server. Please check your "java.home
" setting.
Setting java.home
in JSON solves the issue, but triggers a warning from VS Code: This setting will be deprecated, please use the environment variable 'JAVA_HOME
' instead.
Describe the solution you'd like
It'd be nice for the error message to suggest a non-deprecated solution.
Also, how does one set a JAVA_HOME
environment variable on macOS, notorious for its apps not picking up variables from the shell environment?
Additional context
VS Code version is 1.63.2.
Gradle for Java extension is 3.9.0.
the current version of language support for Java (1.2.0
) just use its own platform specific extension and deprecate java.home
, that's the story. Let me just investigate a proper way to find a JVM to run the language server.
the current version of language support for Java (
1.2.0
) just use its own platform specific extension and deprecatejava.home
, that's the story. Let me just investigate a proper way to find a JVM to run the language server.
java.jdt.ls.java.home
seems to be the new standard which replaces the older java.home
in VS Code. It would also be nice, if the plugin reads java.configuration.runtimes
and picks the entry which has default set to true
.
I have added a pull-request - https://github.com/microsoft/vscode-gradle/pull/1169. Please check.
@ravihara thanks for the pr, I'll take a look.