Open xuwei-k opened 9 months ago
Install JDK 21
A.java
void main() { System.out.println("hello"); }
B.scala
class B
build.sbt
javacOptions ++= Seq( "-Xlint:preview", "--enable-preview", "--release", scala.util.Properties.javaSpecVersion ) scalaVersion := "3.3.1"
project/build.properties
sbt.version=1.9.6
sbt -J--enable-preview compile
[error] 1 |void main() { [error] | ^^^^ [error] | illegal start of type declaration [error] one error found [error] (Compile / compileIncremental) Compilation failed
success compile
3.3.2 will add support to JDK 21. We will probably need to take care of handling the new main methods.
Compiler version
Minimized code
Install JDK 21
A.java
B.scala
build.sbt
project/build.properties
sbt -J--enable-preview compile
Output
Expectation
success compile
Note