Search code examples
javamavensbtjava-15

error: invalid source release: 1.15 error: invalid source release: 15 | JDK 15


what is the value of the source and target version with JDK 15

Build tool -> sbt/maven

i.e javacOptions ++= Seq("-source", "1.10", "-target", "1.10")

Note: Till 11 works fine


Solution

  • You're out of date on 3 fronts. Java is moving fast these days :)

    • Java dropped the 1.x scheme quite a while ago. It's just 15, not 1.15.
    • Java also dropped the -source -target style. It's release these days.
    • The java command line tools adopted posix style command switches, so, double up the -.

    In other words, you're looking for Seq("--release", "15").