-
Notifications
You must be signed in to change notification settings - Fork 345
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
Fails to compile project on Windows with Java 11 (Unknown compiler options: -release, 11) #6829
Comments
Thanks for reporting! What is the full exception that you are getting? Also, does it work if you just change the metals java home to JDK 21? That should only be responsible for JDK Metals is using. |
Ach, that looks like an issue with our reporting. I can fix that, but I don't think that is related to any serious issues. For the -release option we might be adding that automatically, I need to see it in Bloop. |
It turns out code autocompletion doesn't really work either for me when I choose Java 11, but with Java 21 it works perfect (with Java 11 it gives me some completion suggestions still but not everywhere so I think that might be some cached suggestions from previous Java 21 compilation builds) |
@tgodzik thanks you so much for very quick response and the fix! do you have any idea when the next plugin version that includes it comes out? |
I want to wait for another PR in progress and will most likely release at that point. You could try to use the latest Bloop with the latest Metals snapshot already by changing: That should contain the fix. |
Hi
When I try to compile my project with Java 11 (and Scala 2.11.12) I get the following error:
WARNING: Unknown compiler options: -release, 11 Oct 09, 2024 11:22:47 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleNotification WARNING: Notification threw an exception: { "jsonrpc": "2.0", "method": "build/logMessage", "params": { "type": 1, "message": "bad option: \u0027-release\u0027" } } java.nio.file.InvalidPathException: Illegal char <:> at index 12: r_bad option: '-releas..._11-22-47-499.md at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
My Metals Java config:
But it works just fine when I configure it to use Java 21 for some reason (Java 17 gives me the same error). I have to use Java 11 for my project so any help would be appreciated
Build config is generated from maven pom.xml, there are no compiler args set there in pom
I have code autocompletion active but whenever I try to run my code it runs unmodified code (seems like it fails to compile new jar file to .metals/.tmp/... directory but not sure
Operating system:
Windows 11
Java version:
11.0.24
Editor/extension:
Visual Studio Code v1.94.1
Metals version:
1.3.5
Workspace information:
0. Bloop v1.6.0
The text was updated successfully, but these errors were encountered: