Installing Java
The Oracle Java Development Kit (JDK) is required by the Caplin Platform to run Java-based Caplin Platform Blades (CPB) and the JMX monitoring service. This page provides an overview of the steps required to install Oracle Java and set the JAVA_HOME environment variable on Windows, Red Hat Linux and Mac OS X.
The Caplin Platform supports the following versions of the Oracle JDK:
-
Oracle JDK 7 32-bit (Windows, Red Hat Linux)
-
Oracle JDK 7 64-bit (Red Hat Linux, Mac OS X)
-
Oracle JDK 8 32-bit (Windows, Red Hat Linux)
-
Oracle JDK 8 64-bit (Red Hat Linux, Mac OS X)
Follow the platform-specific instructions below.
Microsoft Windows
Follow the instructions below to install Oracle Java and set the JAVA_HOME environment variable.
-
Download and install a 32-bit Oracle JDK from the Oracle website.
The Caplin Platform binaries for the Windows platform are 32-bit and require a 32-bit Oracle JDK. -
On your keyboard, press Windows + Pause to open the System window
-
In the System window, navigate to Advanced system settings > Environment Variables
-
Set the value of the JAVA_HOME system environment variable to the full path to the JDK’s directory. For example:
C:\Program Files (x86)\Java\jdk1.8.0_60
-
Append the JDK’s
bin
subdirectory to the PATH system environment variable, using a semi-colon to separate it from the preceding paths. Rather than repeat the path to the JDK directory, you can reference the JAVA_HOME variable. For example:%JAVA_HOME%\bin
Red Hat Linux
Red Hat Linux supports the installation of multiple JDKs, and provides the alternatives
command to select the active JDK. Follow the instructions below to install Oracle Java and set the JAVA_HOME environment variable.
-
Prepare the
alternatives
file-system links by installing the OpenJDK development package of the same major version as the Oracle JDK you want to install. For example, to prepare for the installation of Oracle JDK 8, install the OpenJDK 8.$ sudo yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
-
From the Oracle website, download the RPM for the version of Oracle JDK that you require.
-
Install the downloaded RPM. The example command below installs the RPM for the Oracle JDK 8 update 65 (64-bit).
$ sudo yum install jdk-8u65-linux-x64.rpm
-
Run the two commands below to select the active Java installation. When prompted, select the Oracle JDK as the default installation.
$ sudo alternatives --config java
$ sudo alternatives --config javac
-
Update your
~/.bash_profile
file with the following lines:JAVAC_PATH=$(readlink -f /etc/alternatives/javac)
export JAVA_HOME=${JAVAC_PATH%/bin/javac}
/etc/alternatives/javac
is an automatically-maintained link that is updated by the commandalternatives --config javac
-
Log off and log back in to your account. The
~/.bash_profile
file is only run on login.
Mac OS X
Follow the instructions below to install Oracle Java and set the JAVA_HOME environment variable.
-
Download and run the Oracle JDK installer from the Oracle website.
-
Update your
~/.bash_profile
file with the following line:export JAVA_HOME=$(/usr/libexec/java_home)
By default, the /usr/libexec/java_home
program returns the path to the most recently installed JDK. -
Log off and log back in to your account. The
~/.bash_profile
file is only run on login.
For more information on installing Oracle Java on OS X, see Information and system requirements for installing and using Oracle Java on Mac OS X.