-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use local java version different from system-wide default for Metals #1558
Comments
Thanks for reporting! We should allow javaPath to be modified by the user. I will take a look at it. As a workaround you can set JAVA_HOME globally or just before starting VS Code from comman line via |
tgodzik
added a commit
to tgodzik/metals-vscode
that referenced
this issue
Dec 12, 2024
Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases. Fixes scalameta#1558
tgodzik
added a commit
to tgodzik/metals-vscode
that referenced
this issue
Dec 12, 2024
Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases. Fixes scalameta#1558
tgodzik
added a commit
to tgodzik/metals-vscode
that referenced
this issue
Dec 12, 2024
Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases. Fixes scalameta#1558
tgodzik
added a commit
to tgodzik/metals-vscode
that referenced
this issue
Dec 12, 2024
Peviously, if use had JAVA_HOME and java on PATH pointing to JDK 11, we would download JDK 17 using coursier. This however might not work if there is no internet and there was no way to work around that. Now, we allow users to specify an override for those cases. Fixes scalameta#1558
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In an environment with no access to the internet, where I have both VSCode, the metals extension, java 11 and java 17 already installed, and java 11 is the default system-wide java version, it is not possible to run metals with a Scala project that requires exactly java 11 both for running and building.
To Reproduce
On ubuntu jammy
Install vscode and the metals extension and open a scala project that requires java 11.
Disconnect from the internet.
Expected behavior
Currently, it is possible to set distinct java versions for metals and the project, e.g. via
However, this only works if either java 17 is the system-wide java binary available in PATH or if there is an internet connection for coursier to use to download java. I would like to be able to tell metals to use the java version at
/usr/lib/jvm/java-17-openjdk-amd64/bin/java
to run itself, and the java home at/usr/lib/jvm/java-11-openjdk-amd64
to run the project, while at the same time not having java 17 being the default version of java available in PATH, and without having a connection to the internet. That is, I think that something like the following should be possibleInstallation:
Additional context
Search terms
JAVA_HOME, javaVersion, javaHome, coursier, offline
The text was updated successfully, but these errors were encountered: