Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

EwoutH
Copy link

@EwoutH EwoutH commented Feb 21, 2024

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:

JDK 18

JDK 19

JDK 20

JDK 21

@EwoutH
Copy link
Author

EwoutH commented Feb 21, 2024

Most tests are already passing, it seems that only drt-extensions and simwrapper currently fail.

@rakow
Copy link
Contributor

rakow commented Feb 21, 2024

Please try again after PR #3126 has been merged.

@EwoutH
Copy link
Author

EwoutH commented Feb 22, 2024

All checks pass!

@michalmac, since you lead the migration from Java 11 to 17, could you give this PR a review?

Copy link
Member

@michalmac michalmac left a 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.

@michalmac
Copy link
Member

Any 👍 or 👎 on merging this PR now?

@rakow
Copy link
Contributor

rakow commented Feb 22, 2024

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.

@EwoutH
Copy link
Author

EwoutH commented Feb 23, 2024

Maybe we can establish a target date to switch to Java 21? With whom should we coordinate/communicate about this?

@Janekdererste
Copy link
Member

Janekdererste commented Feb 26, 2024

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?

@EwoutH
Copy link
Author

EwoutH commented Feb 26, 2024

Switching after the yearly release sounds reasonable. No specific reason, just seemed about time.

@paulheinr
Copy link
Contributor

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.

Java 21 is now installed on the math cluster. But I agree, let's switch after the release.

@EwoutH
Copy link
Author

EwoutH commented Feb 29, 2024

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.

@michalmac
Copy link
Member

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.

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.
@paulheinr
Copy link
Contributor

Since the new release is published, should we now switch to java 21?

@Janekdererste
Copy link
Member

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

@paulheinr
Copy link
Contributor

Since the original PR was created from a forked repository, I created a new one: #3238

@EwoutH
Copy link
Author

EwoutH commented Apr 26, 2024

If (still) necessary I can rebase this branch.

@paulheinr paulheinr closed this in 5a76782 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants