Scala community build on JDK 17

I encourage all Scala open-source maintainers to add JDK 17 to their CI matrices. Now’s a good time, since 17 is feature-frozen, the final release is expected in September, and it will be a “LTS” (long-term support) release.

As of today, the Scala community build (2.12 & 2.13) runs (and is mostly green) on JDK 17. Details: add JDK 17 build · Issue #1432 · scala/community-build · GitHub

The build found that deserialization of lambdas is broken on 2.12 only. @retronym’s fix is already available in nightlies and will ship in 2.12.15. (See also: 2.12.15 planning thread.)

A few repos fail because JDK 17 removes support for global --illegal-access=permit. (I expect using --add-opens instead would work?)

4 Likes

What’s happening with Java records (https://github.com/scala/scala/pull/9551)? This seems to prevent me from using sbt in mixed Java 16 / Scala projects. Or am I missing something?

I don’t know anything more than is given on the pull request. Hopefully Alec (harpocrates) will reappear soon and finish it off. If not, perhaps a different volunteer would like to take it over.

An interested volunteer could even work on pushing it forward right now, using Alec’s work as a starting point; it’s not strictly necessary to wait around for Alec; presumably he’d welcome the help.

Issues · scala/bug · GitHub has some other “help wanted” tickets related to support for post-11 features.

For those using Travis-CI, scala/scala-dev:travis/default.yml has been updated so that ADOPTOPENJDK=17 will get you an early-access build of 17. (JDK selection: allow non-Adopt early access builds by SethTisue · Pull Request #780 · scala/scala-dev · GitHub)

For GitHub Actions users, the setup-java action lets you ask for java-version: 17-ea.

2 Likes