Skip to content
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

Downloading Metals failed with the following error (on Linux) #6925

Closed
sbushmanov opened this issue Nov 9, 2024 · 3 comments
Closed

Downloading Metals failed with the following error (on Linux) #6925

sbushmanov opened this issue Nov 9, 2024 · 3 comments

Comments

@sbushmanov
Copy link

sbushmanov commented Nov 9, 2024

Describe the bug

I'm trying to start a Scala sbt project (which used to work recently) and getting the following in the Metals log:

Metals version: 1.4.0
Using coursier located at /home/sergey/.local/share/coursier/bin/coursier
Checking Java in JAVA_HOME, which points to /usr/lib/jvm/21.fx-librca
	openjdk version "21" 2023-09-19 LTS
	OpenJDK Runtime Environment (build 21+37-LTS)
	OpenJDK 64-Bit Server VM (build 21+37-LTS, mixed mode, sharing)
Using Java Home: /usr/lib/jvm/21.fx-librca
Error: --add-exports requires modules to be specified
Downloading Metals failed with the following:
Process exited with code 1
  Metals version: 1.4.0  
  Server properties: -Xmx2G,-XX:+UseZGC,-XX:ZUncommitDelay=30,-XX:ZCollectionInterval=5,-XX:+IgnoreUnrecognizedVMOptions 
  Java configuration: 
    - coursier: /home/sergey/.local/share/coursier/bin/coursier
    - coursier mirror: undefined
    - extra environment: [object Object]
    - java options: --add-exports
    - java path: /usr/lib/jvm/21.fx-librca/bin/java
    
Trying again with the embedded coursier. This might take longer.
Metals version: 1.4.0
Using coursier located at undefined
Checking Java in JAVA_HOME, which points to /usr/lib/jvm/21.fx-librca
	openjdk version "21" 2023-09-19 LTS
	OpenJDK Runtime Environment (build 21+37-LTS)
	OpenJDK 64-Bit Server VM (build 21+37-LTS, mixed mode, sharing)
Using Java Home: /usr/lib/jvm/21.fx-librca
Error: --add-exports requires modules to be specified
Downloading Metals failed with the following:
Process exited with code 1
  Metals version: 1.4.0  
  Server properties: -Xmx2G,-XX:+UseZGC,-XX:ZUncommitDelay=30,-XX:ZCollectionInterval=5,-XX:+IgnoreUnrecognizedVMOptions 
  Java configuration: 
    - coursier: /home/sergey/.vscode-oss/extensions/scalameta.metals-1.42.0-universal/coursier-fallback.jar
    - coursier mirror: undefined
    - extra environment: [object Object]
    - java options: --add-exports
    - java path: /usr/lib/jvm/21.fx-librca/bin/java
    
Release notes was not shown: not showing release notes since they've already been seen for your current version

Please note the line:

Error: --add-exports requires modules to be specified

When trying to debug on my own, I noticed this may come from a wrong (outdated?) Java.
I updated and still no joy.

Any help (or providing directions) in debugging is highly appreciated.

Thanks in advance!

Expected behavior

Expect the project to be loaded (as it used to load and still loads in Intellij e.g.)

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v.1.4.0

Extra context or search terms

No response

@sbushmanov sbushmanov changed the title Downloading Metals failed with the following Downloading Metals failed with the following on Limux Nov 9, 2024
@sbushmanov sbushmanov changed the title Downloading Metals failed with the following on Limux Downloading Metals failed with the following on Linux Nov 9, 2024
@sbushmanov sbushmanov changed the title Downloading Metals failed with the following on Linux Downloading Metals failed with the following (on Linux) Nov 9, 2024
@sbushmanov sbushmanov changed the title Downloading Metals failed with the following (on Linux) Downloading Metals failed with the following error (on Linux) Nov 9, 2024
@tgodzik
Copy link
Contributor

tgodzik commented Nov 10, 2024

Do you have .sbtopts or .jvmopts specified? We might be taking the properties from there. Adding exports should not be necessary

@tgodzik
Copy link
Contributor

tgodzik commented Nov 10, 2024

Or you could try changing meta.serverProperties to see if the defaults are causing issues

@sbushmanov
Copy link
Author

sbushmanov commented Nov 10, 2024

I'm having a clean project like:

sbt new scala/hello-world.g8
copying runtime jar...
[info] [launcher] getting org.scala-sbt sbt 1.10.5  (this may take some time)...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
A template to demonstrate a minimal Scala application

name [Hello World template]: hw

Template applied in /home/sergey/./hw

None of the .sbtopts or .jvmopts do exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants