Agent Push Fails when pushing to server with Java 17

Answered

We are updating our builds from Java 11 to Java 17.  I have created a new AMI where the only change is installing the Amazon Corretto 17 JDK instead of 11, but now our agent pushes fail with the following error about Java 1.6 missing.  The old AMI did not have Java 1.6 installed, just 11.  Do we need to have Java 11 installed as well as 17 in order for the agent push to succeed?

[17:29:38]: 2022-04-13 17:29:38 (141 MB/s) - âbuildAgent.zipâ saved [234322422/234322422]
[17:29:38]: Extracting agent into '/home/ec2-user/BuildAgent'...
[17:29:39]: Launching Agent installation...
[17:29:39]: Looking for Java Runtime Environment...
[17:29:40]: Java executable of version 1.6 is not found:
[17:29:40]: - Java executable is not found under the specified directories: '/home/ec2-user/BuildAgent/bin/../jre'
[17:29:40]: - Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
[17:29:40]: - Java executable is not found in the default locations
[17:29:40]: - Java executable is not found in the directories listed in the PATH environment variable
[17:29:40]: Please make sure either JAVA_HOME or JRE_HOME environment variable is defined and is pointing to the root directory of the valid Java (JRE) installation
[17:29:40]: Please note that all Java versions starting from 12 were skipped because stable operation on these Java versions is not guaranteed
[17:29:40]: Environment variable FJ_DEBUG can be set to enable debug output
[17:29:40]: Cannot install the Agent due to JRE is not found. Please install JRE or JDK first.
[17:29:40]: Agent Installation script returned non-zero exit code '1'. Terminating[4]
[17:29:40]: Cleaning temporary installation's resources...
[17:29:40]: Removing './bootstrapper.sh'
[17:29:40]: Removing '/home/ec2-user/BuildAgent'
[17:29:41]: Remote agent installation failed: Command '[./bootstrapper.sh "https://xxxx" "buildAgentFull.zip" "/home/ec2-user/BuildAgent" "819109e91068117185e08f4934dfc9df"]' was executed with error message(s): Java executable of version 1.6 is not found:
- Java executable is not found under the specified directories: '/home/ec2-user/BuildAgent/bin/../jre'
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Java executable is not found in the default locations
- Java executable is not found in the directories listed in the PATH environment variable
Please make sure either JAVA_HOME or JRE_HOME environment variable is defined and is pointing to the root directory of the valid Java (JRE) installation
Please note that all Java versions starting from 12 were skipped because stable operation on these Java versions is not guaranteed
Environment variable FJ_DEBUG can be set to enable debug output
0
2 comments

Update: Installing Java 11 along side Java 17 resolved the issue.  Looks like the agent needs to have JRE 11 or lower installed to run.

0

Hi Lorin,

You can find supported Java versions in the Support Platforms and Environments article. Both the server and its agents supports Java 8-11 at the moment.

Note that the JRE your agents run on and JDK your builds are assembled on do not have to be the same. Builds steps that works with JDK (e.g., Maven) allow configuring the JDK individually. 

0

Please sign in to leave a comment.