Fall back to java.jdt.ls.java.home if embedded JRE fails
See original GitHub issueWhen deploying VSCode to an AP Computer Science lab where the students don’t have admin privileges, attempts to enable the latest Extension Pack for Java (which includes the “Language Support for Java™ by Red Hat” extension) fail reporting “Couldn’t start client Language Support for Java” whenever they open a Java project.
Environment
- Operating System: Windows 10
- JDK version: Various (tried latest Microsoft OpenJDK 11 & 17 as well as those from Adoptium’s Teemurin)
- Visual Studio Code version: 1.64.0
- Java extension version: v 1.1.0 through v1.3.0
Steps To Reproduce
- Install latest VSCode and JDK (with JAVA_HOME set correctly)
- Create a new Java class
Current Result
Reports “Couldn’t start client Language Support for Java” when trying to run or debug the Java code.
Expected Result
Should work like it does for users with admin privileges (or how it did for v1.0.0).
Additional Information
Works fine for users with admin privileges or if we roll the students back to v1.0.0 of this extension. Typing java -version in terminal returns correct OpenJDK version.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
VS code & java: This setting is deprecated, please use 'java.jdt ...
Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart. However, if your real problem is...
Read more >Language Support for Java(TM) by Red Hat
The embedded JRE is used to launch the Language Server for Java. ... The path to the Java Development Kit can be specified...
Read more >VSCode Java (@VSCodeJava) / Twitter
the absolute fastest way to get and setup a fully working java development environment locally.
Read more >Maven Error “JAVA_HOME should point to a JDK not a JRE”
Before running any goals, Maven checks for the existence of the java command in the path specified by JAVA_HOME or by asking the...
Read more >Fix JAVA_HOME errors | Invalid directory | Not set or defined
To fix this issue, see if you have both a JRE and JDK installed locally. If you do, ensure that the JAVA_HOME variable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Renamed this so at least we can track it. Probably lower priority given a solution exists, but at least we can revisit in the future.
@Magendanz You can try to disable the embedded JRE. See https://github.com/redhat-developer/vscode-java/issues/2276#issuecomment-1015035058