Setting Java variables on Linux

JAVA_HOME and PATH variables are required for the operating system to find the required Java programs and utilities.

Ensure the required Java version is installed on all nodes in your topology.

If Java is not installed on your install system, refer to the appropriate documentation to install Java before setting JAVA_HOME and PATH. For example, to install IBM JDK (Windows or Linux), see the IBM JDK online documentation.

To set Java variables in Linux:

To set Java variables on Linux, complete the following steps:

  1. Download or save the appropriate JDK version for Linux.
    Important: You can download the JDK from Passport Advantage or Fix Central or save it from the disk.
  2. Extract the compressed file to the required location.
  3. Set JAVA_HOME using the syntax export JAVA_HOME=path to JDK. For example, export JAVA_HOME= /usr/java/jdk1.7.0_05/.
  4. Set PATH by using the syntax export PATH=${PATH}:path to the JDK bin. For example, export PATH=${PATH}:/usr/java/jdk1.7.0_05/bin
    Attention: When you add the bin directory for the IBM JDK to the PATH environment variable, ensure that you add it before any other directory currently listed in the PATH value that might have a Java executable. Also, if the directory that you are adding to the PATH or setting as JAVA_HOME has a space in the path, either contain the path in quotes or escape the space by preceding the path with \.
  5. Verify the settings by using the following commands:
    echo $JAVA_HOME
    
    echo $PATH

    The output must display the JAVA_HOME and PATH that you set.