Skip to content

Commit

Permalink
JENKINS-69581: Update required java version
Browse files Browse the repository at this point in the history
As of Jenkins Weekly 2.357 and LTS 2.361 the minimum required java
version is java 11.

If the command java -fullversion fails we will try to install openjdk-11.

We first try and install it using amazon-linux-extras. If this passes
then the launch continues. If it fails (for example we're launching a
linux node on a distribution other than amazon-linux we try and install
openjdk-11 using yum.

If both of these commands fail we won't launch the node.

At this point we don't explicitly check the java version, but this could
perhaps be a future addition.
  • Loading branch information
grogersxyz committed Nov 20, 2022
1 parent 19d7ebe commit ddea6d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected void launchScript(EC2Computer computer, TaskListener listener) throws

// TODO: parse the version number. maven-enforcer-plugin might help
final String javaPath = node.javaPath;
executeRemote(computer, conn, javaPath + " -fullversion", "sudo yum install -y java-1.8.0-openjdk.x86_64", logger, listener);
executeRemote(computer, conn, javaPath + " -fullversion", "sudo amazon-linux-extras install java-openjdk11 -y || sudo yum install -y fontconfig java-11-openjdk", logger, listener);
executeRemote(computer, conn, "which scp", "sudo yum install -y openssh-clients", logger, listener);

// Always copy so we get the most recent remoting.jar
Expand Down

0 comments on commit ddea6d1

Please sign in to comment.