-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from Java 17 to 21 #3124
Conversation
Most tests are already passing, it seems that only |
Please try again after PR #3126 has been merged. |
All checks pass! @michalmac, since you lead the migration from Java 11 to 17, could you give this PR a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me.
This PR means that the upcoming yearly release will require Java 21. I cannot say if this is good or not for teaching matsim. If not, we should wait out with merging until the yearly release is out. @kainagel what is your opinion?
This change will need to get propagated to dependant repos. I do not think this is an issue.
Any 👍 or 👎 on merging this PR now? |
Our server infrastructure does not have java 21 installed at the moment. Please wait until we had time to switch. I guess others will also need time to adapt. |
Maybe we can establish a target date to switch to Java 21? With whom should we coordinate/communicate about this? |
We could wait until after the yearly release (end of March) and then switch java versions on the development branch. This way, downstream projects only have to switch versions if they depend on a more recent MATSim version than the next release. This would save us from switching many downstream projects at once. Downstream projects can always use more recent Java versions than what their dependencies require, so there is no time pressure from that side. In the matsim-libs project, we would have the new version available in approximately six weeks. @EwoutH Is there a specific reason that you need the newer version? |
Switching after the yearly release sounds reasonable. No specific reason, just seemed about time. |
Java 21 is now installed on the math cluster. But I agree, let's switch after the release. |
An argument for switching before could be that Java 21 is supported for two more years over Java 17, making simulations built now be supported longer and possible future migrations easier. And it's nice to be able to use the latest features (okay, not the very latest, because JDK 22 just released, but still), when developing. I think the main question is, if there's enough time to properly test it before the stable release. |
It works a bit different. By setting the Java version to 17, we mean the bytecode will be built against version 17 (Java 17 language + public API). It can be run on any JDK 17+. |
Update the pom.xml and the GitHub Actions workflows to use Java 21 LTS instead of Java 17 LTS.
Since the new release is published, should we now switch to java 21? |
I don't see why not. Who wants to do this? We then have to migrate downstream projects as well, in case they are using recent matsim versions |
Since the original PR was created from a forked repository, I created a new one: #3238 |
If (still) necessary I can rebase this branch. |
Java 21 LTS has now been release for 6 months, which may be a good time to see if we can start upgrading to Java 21. This PR tests that by updating the
pom.xml
and the GitHub Actions workflows to use Java 21 LTS instead of Java 17 LTS.The previous Java upgrade was done and discussed here:
Potentially interesting articles:
New features in JDK 18, 19, 20 and 21 are: