Installing Java
On the Caplin Platform, a Java runtime environment (JRE) is used to run Java-based DataSources (integration adapters) and to run Java modules in C-based DataSources. This page provides an overview of the steps required to install a Caplin Platform compatible JRE on Red Hat Linux, Microsoft Windows, and macOS.
JRE compatibility
The most recent versions of Caplin Platform 7.1 components are compatible with Oracle Java 8 (<=8u202), Red Hat OpenJDK 8, and Red Hat OpenJDK 11.
For detailed information JRE compatibility, see Caplin Platform System Requirements.
Installing Java on Red Hat Enterprise Linux
To install Red Hat OpenJDK 11 (available in RHEL 7), follow the steps below:
-
Install Red Hat OpenJDK 11:
$ sudo yum install java-11-openjdk-devel
-
In the home directory of the user account used to run Caplin Platform components, edit the file
~/.bash_profile
and set the JAVA_HOME variable to the value below:export JAVA_HOME=/etc/alternatives/java_sdk_11
-
Run the command below and select OpenJDK 11 as the JDK that provides the
javac
command on the command line:$ sudo alternatives --config javac
-
Run the command below and select OpenJDK 11 as the JRE that provides the
java
command on the command line:$ sudo alternatives --config java
Installing Red Hat OpenJDK 8
To install Red Hat OpenJDK 8 (available in RHEL 6 and RHEL 7), follow the steps below:
-
Install Red Hat OpenJDK 8:
$ sudo yum install java-1.8.0-openjdk-devel
-
In the home directory of the user account used to run Caplin Platform components, edit the file
~/.bash_profile
and set the JAVA_HOME variable to the value below:export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
-
Run the command below and select OpenJDK 8 as the JDK that provides the
javac
command on the command line:$ sudo alternatives --config javac
-
Run the command below and select OpenJDK 8 as the JRE that provides the
java
command on the command line:$ sudo alternatives --config java
Installing Oracle Java 8
To install Oracle Java 8 (8u202), follow the steps below:
-
From the Oracle website, download the RPM for Oracle JDK 8 64-bit (8u202).
Versions of the Oracle JDK 8 greater than update 202 (8u202) require a licence for commercial use. For more information, see the Oracle Java SE Licensing FAQ on the Oracle website. -
Install the RPM:
$ sudo yum install ./jdk-<version>-linux-x64.rpm
-
In the home directory of the user account used to run Caplin Platform components, edit the file
~/.bash_profile
and set the JAVA_HOME variable to the value below:JAVAC_PATH=$(readlink -f /etc/alternatives/javac) export JAVA_HOME=${JAVAC_PATH%/bin/javac}
-
Run the command below and select the Oracle JDK 8 as the JDK that provides the
javac
command on the command line:$ sudo alternatives --config javac
-
Run the command below and select the Oracle JDK 8 as the JRE that provides the
java
command on the command line:$ sudo alternatives --config java
-
Log off and log back in to your account.
Installing Java on Microsoft Windows
To install OpenJDK 11 on Microsoft Windows, follow the steps below:
-
Download the Adoptium OpenJDK 11 installer from the Adoptium website.
-
Run the installer, and, when prompted, enable the following installation options:
-
Add to PATH
-
Set JAVA_HOME
-
Installing OpenJDK 8
To install OpenJDK 8 on Microsoft Windows, follow the steps below:
-
Download the Adoptium OpenJDK 8 installer from the Adoptium website.
-
Run the installer, and, when prompted, enable the following installation options:
-
Add to PATH
-
Set JAVA_HOME
-
Installing Oracle Java 8
To install Oracle Java 8 (8u202), follow the instructions below:
-
Download and install the Oracle JDK 8 (8u202) from the Oracle website.
Versions of the Oracle JDK 8 greater than update 202 (8u202) require a licence for commercial use. For more information, see the Oracle Java SE Licensing FAQ on the Oracle website. -
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.You can reference the JAVA_HOME variable when specifying the location of the JDK’s bin
subdirectory. For example:%JAVA_HOME%\bin
Installing Java on Apple macOS
To install OpenJDK 11 on macOS, follow the steps below:
-
Download the Adoptium OpenJDK 11 from the Adoptium website.
-
Follow the macOS PKG installer packages instructions on the Adoptium website.
Installing OpenJDK 8
To install OpenJDK 8 on macOS, follow the steps below:
-
Download the AdoptOpenJDK 8 from the Adoptium website.
-
Follow the macOS PKG installer packages instructions on the Adoptium website.
Installing Oracle Java 8
To install Oracle Java 8 (8u202), follow the steps below:
-
Download and run the Oracle JDK 8 (8u202) installer from the Oracle website.
Versions of the Oracle JDK 8 greater than update 202 (8u202) require a licence for commercial use. For more information, see the Oracle Java SE Licensing FAQ on 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. To return the path to a specific version of Java, use the-v
option. For example, to return the path to the latest version of Java 8, use the line below:export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
-
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 macOS, see Information and system requirements for installing and using Oracle Java on Mac OS X.
On starting a Caplin application, you may see one or both of the errors below:
-
"No Java runtime present, requesting install"
-
"To open this Java application you need to install the legacy Java SE 6 runtime"
These errors appear to be caused by an issue with the default installation of Oracle Java 8 on macOS, which does not declare all of Java 8’s capabilities in Java 8’s macOS application metadata file Info.plist
.