Version(s)
1.13.0
Describe the bug
While having java 11 (or an older version potentially) set as the default JDK , an attempt to start REPL without specifying scala or java version explicitly by default makes scala-cli pick scala 3.8.3 with the older, unsupported java version, which results in a crash with a quite ungraceful error like
Error: LinkageError occurred while loading main class dotty.tools.repl.Main
java.lang.UnsupportedClassVersionError: dotty/tools/repl/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
which might not be understandable for many users.
To Reproduce
Running scala-cli repl or more explicitly with scala-cli repl -S 3.8.3 --jvm 11
Expected behaviour
Probably scala-cli should by default choose some (which?) version of JVM compatible with scala version if the JVM version was not passed explicitly. If java version was passed explicitly (or if it wasn't but it gets decided that we should not set the JVM version implicitly) a clearer error message should be displayed, stating that one need to pass the --jvm or the corresponding using directive
Version(s)
1.13.0
Describe the bug
While having java 11 (or an older version potentially) set as the default JDK , an attempt to start REPL without specifying scala or java version explicitly by default makes scala-cli pick scala 3.8.3 with the older, unsupported java version, which results in a crash with a quite ungraceful error like
which might not be understandable for many users.
To Reproduce
Running
scala-cli replor more explicitly withscala-cli repl -S 3.8.3 --jvm 11Expected behaviour
Probably scala-cli should by default choose some (which?) version of JVM compatible with scala version if the JVM version was not passed explicitly. If java version was passed explicitly (or if it wasn't but it gets decided that we should not set the JVM version implicitly) a clearer error message should be displayed, stating that one need to pass the
--jvmor the corresponding using directive