scala-cli
scala-cli copied to clipboard
Packaging a simple Java app with --jvm 8 --server=false fails
Repro:
$ cat > Test.java << EOF
public class Test {
public static void main(String[] args) {
System.out.println("Test");
}
}
EOF
$ scala-cli compile --jvm 8 --server=false Test.java
javac: invalid flag: --release
Usage: javac <options> <source files>
use -help for a list of possible options
Compilation failed
I think this could be fixed by returning a sensible value here.
I'm getting a similar error but it's not specific to packaging in my case Given a scala file, e.g.
// Tmp.scala
object Foo
when on JVM 8
$ java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)
compiling the file with specific scala version and disabled server causes a crash, e.g.
$ scala-cli compile Tmp.scala -S 3.1.1 --server=false
8 is not a valid choice for -release
scalac -help gives more information
Compilation failed
I'm using scala-cli v0.1.14
We should not add the -release flag for Java as this can be handled by the forked compiler in Bloop. We just need to make sure that proper Java is set in the json configuration.