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

Add preview support for Java 17 #298

Merged
merged 2 commits into from
Mar 11, 2022
Merged

Add preview support for Java 17 #298

merged 2 commits into from
Mar 11, 2022

Conversation

basil
Copy link
Member

@basil basil commented Mar 11, 2022

As of jenkinsci/jenkins#6356 there is no longer any need for --add-opens on Java 17, but there is still a problem with the version check in this repository which causes a hard failure on anything other than Java 8 and Java 11. I considered removing this entirely, as it seems to be a bit heavy-handed, but then I decided that it is a useful guardrail to prevent users from accidentally running Jenkins in an unsupported configuration. So instead I am just skipping the Java version check when the --enable-future-java Jenkins option is provided, which is needed to enable Java 17 preview support anyway.

Testing done

Functional testing: started Jenkins successfully with Java 17 and this systemd configuration (with jenkinsci/jenkins#6356):

[Service]
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
Environment="JENKINS_OPTS=--enable-future-java"
Environment="JENKINS_WAR=/home/basil/src/jenkinsci/jenkins/war/target/jenkins.war"

Regression testing: started Jenkins successfully with Java 11 and this systemd configuration:

[Service]
Environment="JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"

Fixes #217

@basil basil requested a review from a team as a code owner March 11, 2022 16:55
@basil
Copy link
Member Author

basil commented Mar 11, 2022

Also tested starting with Java 17 without --enable-future-java and confirmed that it still correctly fails. While testing that, found a minor bug in the display of the error message which I corrected in commit af308c4.

@basil basil merged commit 5707f90 into jenkinsci:master Mar 11, 2022
@basil basil deleted the java17 branch March 11, 2022 20:33
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.

Add --add-opens to installations running on java 17
2 participants