//> using scala 3
//> using jvm 21
@main def hello =
val x: com.sun.source.tree.AnyPatternTree = ???
Error log
```
* Executing task: /"opt"/"homebrew"/"Cellar"/"openjdk@17"/"17.0.7"/"libexec"/"openjdk.jdk"/"Contents"/"Home"/"bin"/"java" -classpath "/Users/jrochala/Projects/scala-cli-playground/.metals/.tmp/classpath_27F172492313EEA3967CB8BD059EAD98.jar" hello
Error: LinkageError occurred while loading main class hello
java.lang.UnsupportedClassVersionError: hello has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
* The terminal process "/etc/profiles/per-user/jrochala/bin/zsh '-l', '-c', '/"opt"/"homebrew"/"Cellar"/"openjdk@17"/"17.0.7"/"libexec"/"openjdk.jdk"/"Contents"/"Home"/"bin"/"java" -classpath "/Users/jrochala/Projects/scala-cli-playground/.metals/.tmp/classpath_27F172492313EEA3967CB8BD059EAD98.jar" hello '" failed to launch (exit code: 1).
* Terminal will be reused by tasks, press any key to close it.
```
Expected behavior
It should work
Screenshots
Installation:
Operating system: macOS/Windows/Linux
VSCode version:
VSCode extension version:
Metals version: 1.1.0
Additional context
Metals uses java from classpath to run the code. It should use the same java that is defined in Scala-CLI using directive
Describe the bug
To Reproduce Steps to reproduce the behavior:
Error log
``` * Executing task: /"opt"/"homebrew"/"Cellar"/"openjdk@17"/"17.0.7"/"libexec"/"openjdk.jdk"/"Contents"/"Home"/"bin"/"java" -classpath "/Users/jrochala/Projects/scala-cli-playground/.metals/.tmp/classpath_27F172492313EEA3967CB8BD059EAD98.jar" hello Error: LinkageError occurred while loading main class hello java.lang.UnsupportedClassVersionError: hello has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 * The terminal process "/etc/profiles/per-user/jrochala/bin/zsh '-l', '-c', '/"opt"/"homebrew"/"Cellar"/"openjdk@17"/"17.0.7"/"libexec"/"openjdk.jdk"/"Contents"/"Home"/"bin"/"java" -classpath "/Users/jrochala/Projects/scala-cli-playground/.metals/.tmp/classpath_27F172492313EEA3967CB8BD059EAD98.jar" hello '" failed to launch (exit code: 1). * Terminal will be reused by tasks, press any key to close it. ```Expected behavior
It should work
Screenshots
Installation:
Additional context
Metals uses java from classpath to run the code. It should use the same java that is defined in Scala-CLI using directive
Search terms