You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version(s)
Scala CLI version: 1.0.0-RC2
Scala version (default): 3.2.2
Describe the bug
Today I was resolved to try scala-cli again, so I zapped my caches, followed the getting started on scala-lang, googled for scala-cli docs because I saw an announcement recently about the latest version, kind of finally found the virtuslab blog, though not the recent announcement I thought I remembered.
This is to say, I was surprised there was still more than one step to start using scala-cli, which I will use often because the FOMO was killing me.
Trying the trivial pwd example requires tweaks, but the hard part is having to downgrade my ambient JDK or install via --jvm 19.
To Reproduce
➜ snips scala-cli pwd.sc
Compiling project (Scala 3.2.2, JVM)
Error: 20 is not a valid choice for -java-output-version
scalac -help gives more information
Error compiling project (Scala 3.2.2, JVM)
Compilation failed
It still fails if I add
//> using option -java-output-version:19
Expected behaviour
It would be nicer not to specify the compiler option, which ought to default to what is natural.
Unfortunately, scalac doesn't report its default:
-java-output-version Compile code with classes specific to the given version of the Java platform available on the
classpath and emit bytecode for this version. Corresponds to -release flag in javac.
Choices 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
Scala 2 does the obvious and uses the obvious option name:
-release:<release> Compile for a version of the Java API and target class file. (8,9,10,11,12,13,14,15,16,17,18,19,[20])
The text was updated successfully, but these errors were encountered:
Hi @som-snytt, thanks for reporting. Scala CLI uses the -release option, which is now aliased to -java-output-version for backward compatibility with older Scala versions.
Setting -release 19 should solve the issue, allowing you to override the default value:
//> using option -release 19
I think that if users pass //> using option -java-output-version:19, scala-cli should override the default for --release options.
Version(s)
Scala CLI version: 1.0.0-RC2
Scala version (default): 3.2.2
Describe the bug
Today I was resolved to try scala-cli again, so I zapped my caches, followed the getting started on scala-lang, googled for scala-cli docs because I saw an announcement recently about the latest version, kind of finally found the virtuslab blog, though not the recent announcement I thought I remembered.
This is to say, I was surprised there was still more than one step to start using
scala-cli
, which I will use often because the FOMO was killing me.Trying the trivial
pwd
example requires tweaks, but the hard part is having to downgrade my ambient JDK or install via--jvm 19
.To Reproduce
It still fails if I add
Expected behaviour
It would be nicer not to specify the compiler option, which ought to default to what is natural.
Unfortunately, scalac doesn't report its default:
Scala 2 does the obvious and uses the obvious option name:
The text was updated successfully, but these errors were encountered: