-
Notifications
You must be signed in to change notification settings - Fork 337
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
Metals unable to find Java 11 JDK #2020
Comments
Thanks for reporting! We do use an utility library for locating java home, but it might not work with all possible configuration unfortunately. Could you try specifying java home in the settings? The exact settings is Also, are there any other messages in the metals output? There might be some more info there saying what else could be an issue. |
That fixes it. I'm so sorry, not sure how I missed that configuration! Thanks! |
Glad it helped! This probably means the message is not clear enough. |
I tried different approaches and only the last one worked:
Why is /usr/bin/java/ not working? Is vscode not able to dissolve symlinks? |
I think $JAVA_HOME should work, although VS Code will most of the time be started without the JAVA_HOME env variable. You would most likely need to to start it from terminal to have it defined. |
I ran into the exact same confusion today: Saw the Since the warning message isn't clear enough, maybe consider simply looking for |
Good idea, changed it in scalameta/metals-vscode#644 |
No, in most linux distros you'll see as @bes1002t points out, something like:
Seems that vs code doesn't resolve symlinks, so your only option is to hard code the path, which is unfortunate. |
How would using We could possibly try to resolve the symlink and go up the directories to infer real java home, which might work. Would you mind raising it in VS Code repository |
I was incorrect, it does of course link to the java binary. If the path resolves to a file named "java", then yes, you could probably traverse up to find java home. That would be a nice set-it-and-forget-it option for Linux users. |
|
I've just installed the metals extension from VSCode's marketplace and opened a scala file. I immediately got this error -
I had JDK 14 installed but since metals explicitly mentioned JDK 11, I did go ahead and install it and configured the
java.home
property aswhich is in fact the correct path. Yet, the error persists.
OS: Fedora 32
The text was updated successfully, but these errors were encountered: