The below steps explain how to manually remove an incorrect version of Java, install the correct version of Java, and set its environment variables to function as expected in Mobility Suite:
Java Download, Uninstall, and Reinstall
1. Download the "jdk-8u5-linux-x64.zip" file by clicking the hyperlink on its name and transfer it to the Mobility Suite Server.
*Note* - The remainder of these steps will be performed using the Linux Terminal on the Mobility Suite Server.
2. Any Java JRE or JDK that was previously installed should be removed to avoid any possible adverse effects. Run the below command to remove it:
yum remove java
3. Press the "y" key when prompted if it is okay to remove any "jre" or "jdk" entries found. If there is no previously installed version of Java, then the below command will explain that no package exists:
4. Unzip the "jdk-8u5-linux-x64.zip" file from the directory where it was saved.
unzip jdk-8u5-linux-x64.zip
5. Install the new version from the directory where the "jdk-8u5-linux-x64.rpm" is located:
rpm -ivh jdk-8u5-linux-x64.rpm
Set Java JDK's Environment Variables
Once the proper JDK package is installed, The java variables need to be set by using the below example:
1. Edit the root user's bash profile:
vi ~/.bash_profile
2. Add a new "export JAVA_HOME=" entry at the end of the file (or edit an existing entry) by pressing "i" to enter into "INSERT" mode and set it to the location of the new installation. It should look like the below example:
export JAVA_HOME=/usr/java/jdk1.8.0_05
3. Add another line by pressing the <Enter> key, add the "export PATH=" entry (or edit an existing entry) at the end of the file, and set it to the location of the new installation. It should look like the below example:
export PATH=$JAVA_HOME/bin:$PATH
4. Hit the <Esc> key and type ":wq" exit "INSERT" mode and save changes to the file:
:wq
5. Reset the root user's bash profile:
source ~/.bash_profile
6. Edit the all users' bash profile:
vi /etc/profile
7. Type "Shift + G" to go to the end of the file, press "i" to enter into "INSERT" mode and input the same "export" entries from the root user's profile into this all users' profile:
export JAVA_HOME=/usr/java/jdk1.8.0_05
export PATH=$JAVA_HOME/bin:$PATH
8. Hit the <Esc> key and type ":wq" exit "INSERT" mode and save changes to the file:
:wq
9. Reset the all users' bash profile:
source /etc/profile
Verify the Java JDK Version and Paths
1. Verify the updated JAVA_HOME directory by typing in the below command and pressing the <Enter> key:
echo $JAVA_HOME
2. Verify the PATH to the java executable by typing the below command and pressing the <Enter> key:
echo $PATH
3. Verify the new Java JDK version by typing the below command and pressing the <Enter> key:
java -version
If the responses match the updated Java JDK directory and version, then this process has been completed successfully.