Configure a server to install Java

Configure a server definition to Install Java on first deployment

1. Command Line install

The following steps enable you to install Java onto the target server before the first job is run on this target.
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘Transport Tab’ 
  • Make sure the plugin selected is the ‘SSH Transport’ plugin.
  • Scroll down to the ‘Alternative Execution Mode’ panel.
  • Choose the execution mode (None/SU/SUDO/PBRUN)
  • The RapidDeploy job execution command is inserted at the end of the commands in the ‘Starting Execution Parameters’ and before those in the  ‘Ending Execution Parameters’ 
  • Add the Java install command before the job in the ‘Starting Execution Parameters’ 
  • In the following example we are connecting as the ec2-user to an Amazon instance and already running sudo to su -c “ before the job execution (to run the deployment as root) and just an ending  quote () as the ending execution parameter.
  • We add in the command to install Java just before the deployment command runs as follows below (this example shows using yum on RHEL or CentOS: yum install java -y;).
For the first deployment to deploy to this server, Java will be installed just before the deployment runs. On subsequent deployments the command will be ignored.

2. Push Java to the target

Alternatively, you can push a version of Java that is unzipped on the RapidDeploy server to the target server. In order to do this, follow the steps below:
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘Transport Tab’ 
  • Make sure the plugin selected is the ‘SSH Transport’ plugin.
  • Scroll down to the ‘Java Settings’ panel.
  • Set ‘Java Managed by RapidDeploy’ to ‘true’.
  • Enter the local and remote JAVA_HOME paths for the JRE. The local path must be a path to the JRE to copy to the target.
  • RapidDeploy will install Java to the supplied  ‘Remote JAVA_HOME Path‘ and subsequently use this version when running jobs on this target.

3. Source a specific (existing) Java version

It is often the case that multiple versions of Java are installed on a target server. By default, RapidDeploy will use the version of Java set in the shell of the user executing the job. RapidDeploy requires Java 1.8 to run all possible tasks successfully. Where the version of Java required is different to that set in the users environment, use the following steps to specify the correct Java location:
  • Navigate to your server definition in RapidDeploy ‘Resources’ -> ‘Servers’ -> [SERVER] -> ‘Transport Tab’ 
  • Make sure the plugin selected is the ‘SSH Transport’ plugin.
  • Scroll down to the ‘Java Settings’ panel.
  • Set  Java Managed by RapidDeploy’ to ‘false’
  • Set the ‘Remote JAVA_HOME Path‘ to the correct Java install on the target.