Skip to content

JAVA_HOME or java.jdt.ls.java.home should not be required for projects that don't develop Java code #1249

@tudortimi-ifx

Description

@tudortimi-ifx

Extension Name: vscode-gradle
Extension Version: v3.12.2
OS Version: RHEL8
VSCode version: 1.62.2

Describe the bug
The extension complains about not finding a setting for JAVA_HOME or java.jdt.ls.java.home, even when it's not being used to develop Java code. The extension seems to partially work, though. No language server is started, but Gradle tasks can be executed.

To Reproduce
Start VS Code with extension installed without installing Java extension, without setting a JAVA_HOME environment variable (but with java in PATH.

Expected behavior
I would expect the extension to fall back on the system location for java, which is on PATH, like Gradle itself does, and not require JAVA_HOME or the Java VS Code extension. I see from #249 that this is what the extension used to do.

Screenshots
image

Output from "Gradle for Java"
Log showing that the system installation for Java is being taken, but I'm guessing this comes from Gradle, not from VS Code.

[info] [gradle-server] Server started, listening on 43861
[info] Gradle client connected to server
[info] Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-2.el8_4.x86_64
[info] JVM Args: -XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant

Does the bug still exist if you disable all other extensions?
Yes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions