Updating the JDK Location in an Existing Oracle Home

The getProperty.sh|cmd script displays the value of a variable, such as JAVA_HOME, from the .globalEnv.properties file. The setProperty.sh|cmd script is used to set the value of variables, such as OLD_JAVA_HOME or JAVA_HOME that contain the locations of old and new JDKs in the .globalEnv.properties file.

The getProperty.sh|cmd and setProperty.sh|cmd scripts are located in the following location:

(UNIX) ORACLE_HOME/oui/bin
(Windows) ORACLE_HOME\oui\bin
Where, ORACLE_HOME is the directory that contains the products using the current version of the JDK, such as jdk1.8.0_121.

To update the JDK location in the .globalEnv.properties file:
  1. Use the getProperty.sh|cmd script to display the path of the current JDK from the JAVA_HOME variable. For example:

    (UNIX) ORACLE_HOME/oui/bin/getProperty.sh JAVA_HOME
    (Windows)  ORACLE_HOME\oui\bin\getProperty.cmd JAVA_HOME
    echo JAVA_HOME
    Where JAVA_HOME is the variable in the .globalEnv.properties file that contains the location of the JDK.

  2. Back up the path of the current JDK to another variable such as OLD_JAVA_HOME in the .globalEnv.properties file by entering the following commands:

    (UNIX) ORACLE_HOME/oui/bin/setProperty.sh -name OLD_JAVA_HOME -value specify_the_path_of_current_JDK
    (Windows) ORACLE_HOME\oui\bin\setProperty.cmd -name OLD_JAVA_HOME -value specify_the_path_of_current_JDK

    This command creates a new variable called OLD_JAVA_HOME in the .globalEnv.properties file, with a value that you have specified.
  3. Set the new location of the JDK in the JAVA_HOME variable of the .globalEnv.properties file, by entering the following commands:

    (UNIX) ORACLE_HOME/oui/bin/setProperty.sh -name JAVA_HOME -value specify_the_location_of_new_JDK
    (Windows) ORACLE_HOME\oui\bin\setProperty.cmd -name JAVA_HOME -value specify_the_location_of_new_JDK

    After you run this command, the JAVA_HOME variable in the .globalEnv.properties file now contains the path to the new JDK, such as jdk1.8.0_131.