-
Notifications
You must be signed in to change notification settings - Fork 102
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
Update basic templates default Java version to JDK 17 #564
Conversation
For Windows I switched from AdoptOpenJDK to Temurin (the new name for the project) For Ubuntu we will need to change the apt-get install
@@ -1,6 +1,6 @@ | |||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |||
|
|||
choco install -y adoptopenjdk11 | |||
choco install -y temurin17 |
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.
Looks like these scripts were broken by chocolatey 2, I'm testing a fix atm
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.
I had considered switching this to use winget:
winget install EclipseAdoptium.Temurin.17.JDK
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.
winget is only available from window server 2022+ as far as I remember
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.
The alternative would be to use the Adoptium API directly
# Set the URL for the Adoptium API
$downloadUrl = "https://api.adoptium.net/v3/installer/latest/17/ga/windows/x64/jdk/hotspot/normal/eclipse"
# Specify the download location
$destination = "$env:TEMP\temurin17.msi"
# Download the JDK installer
Invoke-WebRequest -Uri $downloadUrl -OutFile $destination
# Install the JDK
Start-Process -FilePath msiexec.exe -ArgumentList "/i", $destination, "/quiet", "/norestart" -Wait
# Clean up the installer file
Remove-Item $destination
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.
Chocolatey 2.x requires .net 4.8 which isn't installed by default on older windows and requires a reboot to install on those.
@@ -4,6 +4,6 @@ set -ex | |||
|
|||
# Install Java | |||
sudo apt-get -y update | |||
sudo apt-get install -y default-jdk | |||
sudo apt-get install -y openjdk-17-jdk |
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.
worked:
java.vm.name = OpenJDK 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 17
java.vm.vendor = Ubuntu
java.vm.version = 17.0.12+7-Ubuntu-1ubuntu220.04
@@ -128,7 +128,6 @@ public final class Constants { | |||
public static final String WINDOWS_SERVER_2022 = "Windows Server 2022"; | |||
public static final String WINDOWS_SERVER_2019 = "Windows Server 2019"; | |||
public static final String WINDOWS_SERVER_2016 = "Windows Server 2016"; | |||
public static final String UBUNTU_1604_LTS = "Ubuntu 16.04 LTS"; |
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.
openjdk-17-jdk
is not available on Ubuntu 16, given its so far out of support I've removed it from the list.
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.
make sense to me
Thanks! |
when do you expect we will have a new release of this plugin? |
next 5-10 mins or so i'd expect, its automated. |
Going forwards Jenkins will only support JDK17+ (https://www.jenkins.io/blog/2024/06/11/require-java-17/)
For Windows I switched from AdoptOpenJDK to Temurin (the new name for the project)
For Ubuntu I've changed to explicitly stating JDK17
Testing done
Submitter checklist