playframework / play1

Play framework
https://www.playframework.com/documentation/1.4.x/home
Other
1.58k stars 683 forks source link

Support for Java 21 #1458

Open ath0mas opened 8 months ago

ath0mas commented 8 months ago

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"

bigclumsyoaf commented 8 months ago

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.

ath0mas commented 8 months ago

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.

cies commented 3 months ago

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

osmanirosado commented 3 months ago

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.