Migrating from Oracle Java 8 to OpenJDK 1.8.0
To upgrade Java, the following Open Java Runtime Environment (JRE) or Java Development Kit (JDK) RPM packages are recommended:
- java-1.8.0-openjdk-headless
- java-1.8.0-openjdk-devel
The RPM packages execute all necessary actions to install and configure Java, and update the operating system (OS) configuration. Web Services and Applications uses the default Java version that is configured on the node. Therefore, if Oracle Java was installed previously using a Java RPM package, the newly installed/updated OpenJDK should be selected as default one.
Invoke update-alternatives util and select the required Java installation:
update-alternatives --config java
There are 4 programs which provide 'java'.
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/java/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /usr/java/jdk1.8.0_92/jre/bin/java
*+ 4 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
Enter to keep the current selection[+], or type selection number:
In some cases, it might not be possible to update the default Java version on the node. Complications with other applications or circumstances might prevent a successful update. In this case, you can configure Web Services and Applications to use a specific Java version. Use the JAVA variable in the /etc/default/gws file. For example:
# JAVA
# defines the Java that have to be used if several versions are installed on the host.
JAVA=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java