Skip to content

Commit

Permalink
JENKINS-69581: Install java-11-openjdk
Browse files Browse the repository at this point in the history
If Jenkins recieves a non-zero error code when runing `java
-fullversion` on the remote agent then it will install java 11 using
amazon-linux-extra and yum.

Previously this installed java 8 which is no longer supported on Jenkins agents
where the controller is running version 2.361.x or higher
  • Loading branch information
Geordie Rogers committed Sep 19, 2022
1 parent bce0116 commit ea11667
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 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,9 @@ 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; "
+ "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 ea11667

Please sign in to comment.