Support for JDK 20 has already been merged and is available in JDK 20, a non-LTS release, came out in March 2023. Support for JDK 19 was included in Scala 2.13.9 and 2.12.16. JDK 19, a non-LTS release, came out in September 2022. Support for JDK 18 was included in Scala 2.13.7 and 2.12.15. JDK 18, a non-LTS release, came out in March 2022. (It will print a warning on startup about TrapExit that you can ignore.)įor possible Scala issues, see the jdk11 and jdk17 labels in the Scala 2 bug tracker. The Scala test suite and Scala community build are green on JDK 17.įor sbt users, sbt 1.6.0-RC1 is the first version to support JDK 17, but in practice sbt 1.5.5 may also work. To track progress on JDK 11 related issues in Scala, watch: ![]() (If you are still on the 0.13.x series, use 0.13.18.) Scala 2.13.x will eventually provide rudimentary support for this (perhaps only in nightlies built on JDK 11).įor sbt users, JDK 11 support requires minimum sbt version 1.1.0. The Scala compiler does not enforce the restrictions of the Java Platform Module System, which means that code that typechecks may incur linkage errors at runtime. The Scala test suite and Scala community build are green on JDK 11. We build and test Scala using Temurin primarily, but the differences are unlikely to matter to most users. OpenJDK comes in various flavors, offered by different providers. GraalVM performs well on the Scala benchmarks, and it benefits from GraalVM runtime and runs faster too. Most JDK 11+ users are using OpenJDK, or GraalVM which runs in the context of OpenJDK. JDK 8 users typically use the Oracle JDK or some flavor of OpenJDK. In almost every case, you’re free to use the JDK and JVM of your choice. (For example, in 2.13.x we might eventually provide support for JPMS module access checks, to ensure your code won’t incur LinkageErrors due to module access violations.) JDK vendors and distributions We will give higher priority to bugs that break this property. (Lightbend may be able to offer faster resolution of issues like this under commercial support.)Īs already mentioned, Scala code compiled on JDK 8 should run without problems in later JVMs. We may also test non-LTS versions, but any issues found there are considered lower priority, and will not be considered release blockers. The current LTS versions are normally tested in our CI matrix and by the Scala community build. Scala provides experimental support for running the Scala compiler on non-LTS versions of the JDK. These versions will remain supported (by Oracle, and likely by the rest of the ecosystem, including Scala) for longer than the versions in between. (For this reason, some Scala developers use a newer JDK for their daily work but do release builds on JDK 8.) Long Term Support (LTS) versionsĪfter Java 8, Oracle introduced the concept of LTS versions of the JDK. If you compile on JDK 11+ but want to allow your users to stay on 8, additional care is needed to avoid using APIs and features that don’t exist in 8. JDK 8 remains in use at some shops (as of early 2023), but usage is declining and some projects are dropping support. Since the JVM is normally backwards compatible, it is usually safe to use a newer JVM for running your code than the one it was compiled on, especially if you are not using JVM features designated “experimental” or “unsafe”. JDK 8, 11, 17, and 20 are all reasonable choices both for compiling and running Scala code. ![]() The linked page includes contact information for inquiring about supported and recommended versions. Lightbend offers commercial support for Scala 2. In general, Scala works on JDK 11+, including GraalVM, but may not take special advantage of features that were added after JDK 8. Using latest patch version is always recommendedĮven when a version combination isn’t listed as supported, most features may still work. Sometimes new JVM and JDK (Java Development Kit) versions require us to update Scala to remain compatible. ![]() (Other supported platforms: Scala.js, Scala Native.) Scala’s primary platform is the Java Virtual Machine (JVM). Info: JavaScript is currently disabled, code tabs will still work,
0 Comments
Leave a Reply. |