play1 icon indicating copy to clipboard operation
play1 copied to clipboard

Support for Java 21

Open ath0mas opened this issue 2 years ago • 5 comments

Play Version

1.7.1

Operating System

All

JDK

21

Library Dependencies

.

Expected Behavior

Start and run fine with JDK 21.

And possibly update Java source doc to add Java 16, as it seems to be missing in the list while correct in the source code.

Actual Behavior

CompilationException "Incompatible Java version specified 21. Compatible versions are: 11, .., 19"

ath0mas avatar Nov 04 '23 23:11 ath0mas

I forked a Java 21 branch for my own local testing: https://github.com/targetis/play1/tree/java-21

I had to use Eclipse JDT Core Batch compiler Stable release 4.30M1, as 4.29 release doesn't have the VERSION_21 compiler option.

bigclumsyoaf avatar Nov 07 '23 12:11 bigclumsyoaf

I am already able to do a basic debug run adding "21" as a String through a non-suspending breakpoint in my IDE, over an 1.7.1. It is running pretty fine until now 😊

But better do proper updates and checks for the sources and dependencies for sure.

ath0mas avatar Nov 07 '23 17:11 ath0mas

I had the experience with RePlay that all worked well until I upgraded beyond JDK 18. Hibernate 5.6 does not support it.

cies avatar Mar 25 '24 11:03 cies

I updated the libraries ecj and jdt core to support JDK 21 compilation target. The number 21 was added to the list of compatible java versions. See this pull request. I was able to compile a switch expression with pattern matching.

osmanirosado avatar Mar 27 '24 13:03 osmanirosado

The number 21 was added to the list of compatible java versions. See this pull request.

As long as Play1 prescribes Hibernate 5.6 it is technically not able to support beyond JDK18 (the upper limit of Hibernate 5.6). Not sure what will break, maybe the Hibernate devs/ issues tracker can elaborate on this.

cies avatar Aug 15 '24 09:08 cies