Skip to content

Update to JDK22 for building #11057

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

Closed
wants to merge 5 commits into from
Closed

Update to JDK22 for building #11057

wants to merge 5 commits into from

Conversation

koppor
Copy link
Member

@koppor koppor commented Mar 20, 2024

JDK22 is generally available (GA). Since we use the Gradle Toolchain feature, we can use it for building.

I did NOT update the JDK for gradle itself, gradle itself does not support JDK22 yet (gradle/gradle#26162).

  • Update documentation that JDK 22 should be used in IntelliJ

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member

Do we use it for deployment/building? Because jdk21 is long term and 22 might not yet be available for all unix distributions pakaged etc, This will create issues with people building jabref themselves

@koppor
Copy link
Member Author

koppor commented Mar 20, 2024

Updated EA build to use 23 only:

image

Copy link
Contributor

github-actions bot commented Mar 20, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@koppor
Copy link
Member Author

koppor commented Mar 20, 2024

Do we use it for deployment/building?

With this configuration: yes.

We do not yet use JDK 22 features. But we are ready now. The variable https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api/-java-version/-v-e-r-s-i-o-n_22/index.html exist.

New on JDK 22: https://www.infoworld.com/article/3708329/jdk-22-the-new-features-in-java-22.html

Maybe the "structured concurrency" is cool for our file indexer:

With structured concurrency, from Project Loom, concurrent programming is simplified through an API that treats groups of related tasks running in different threads as a single unit of work,

And even cool String templates: https://openjdk.org/jeps/459

Oh, we finally do have _ to ignore variables - https://openjdk.org/jeps/456


Because jdk21 is long term and 22 might not yet be available for all unix distributions pakaged etc, This will create issues with people building jabref themselves

At least debian has JDK22 (https://packages.debian.org/sid/openjdk-22-jdk). 😅

@Siedlerchr
Copy link
Member

Rather arch and other distributions...https://archlinux.org/packages/?sort=&q=openjdk&maintainer=&flagged=

@koppor koppor mentioned this pull request Mar 20, 2024
6 tasks
@koppor
Copy link
Member Author

koppor commented Mar 20, 2024

I think, we have to wait until JDK22 appears somehow in the Gradle Java compatibility matrix


This motivates me to try out bld or Bach :)

@koppor koppor closed this Mar 20, 2024
@koppor
Copy link
Member Author

koppor commented Mar 20, 2024

Gradle 8.7 will support compiling using JDK22: gradle/gradle#26245

@koppor koppor mentioned this pull request Mar 20, 2024
6 tasks
@koppor
Copy link
Member Author

koppor commented Mar 20, 2024

JDK22 compilation is enabled in #11059 (for the EA builds only)

@koppor koppor deleted the update-to-jdk22 branch March 25, 2024 20:12
@koppor koppor added this to the 6.0-alpha milestone Jul 4, 2024
@koppor koppor restored the update-to-jdk22 branch July 4, 2024 20:08
@koppor
Copy link
Member Author

koppor commented Jul 4, 2024

#11430 might need unnamed variables -- thus reopening the PR. Should happen for JabRef 6.0

@koppor koppor reopened this Jul 4, 2024
@koppor
Copy link
Member Author

koppor commented Jul 10, 2024

Oh, we also need to update the workflows themselves to enable jpackage. Otherwise:

Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 66.0

@koppor
Copy link
Member Author

koppor commented Jul 10, 2024

Seeing that Java 25 is going to be an LTS again (see https://www.oracle.com/de/java/technologies/java-se-support-roadmap.html), we could wait 1 year for a Java update. Seeing the effort for updating (also at the local developer's machine), unless we really require a new feature, we should stick with LTS.

@koppor koppor closed this Jul 10, 2024
@koppor koppor deleted the update-to-jdk22 branch July 10, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants