There may be multiple ways for achieving this, in this post I will be upgrading by installing new JDK home directory and replacing all the JAVA_HOME references from weblogic scripts to new JDK directory.
In this post I will upgrade JDK 1.7 Update 40 used by Weblogic server to JDK 1.7 Update 171
Check existing JDK version, for me its installed in /usr/java/jdk1.7.0_40
[oracle@oel1]$ /usr/java/jdk1.7.0_40/bin/java -fullversion
java full version “1.7.0_40-b43”
Download and unzip JDK 1.7 Update 171 : Patch 27334355
[oracle@oel1]$ mkdir /u01/java
[oracle@oel1]$ unzip p27334355_170171_Linux-x86-64.zip
[oracle@oel1]$ tar -xvf jdk-7u171-linux-x64.tar.gz
[oracle@oel1]$ /u01/java/jdk1.7.0_171/bin/java –fullversionjava full version “1.7.0_171-b31”
Stop all FMW processes from the current FMW home
Find all the files required change of JAVA_HOME (where /usr/java/jdk1.7.0_40 is my existing JAVA_HOME)
[oracle@oel1]$ cd $MW_HOME
[oracle@oel1]$ find . -type f -name “*.sh” -exec grep -il /usr/java/jdk1.7.0_40 {} \;
./utils/quickstart/quickstart.sh
./utils/bsu/bsu.sh
./utils/uninstall/uninstall.sh
./user_projects/domains/IDMDomain/bin/setDomainEnv.sh
./wlserver_10.3/common/bin/commEnv.sh[oracle@oel1]$ find . -type f -name “*.properties” -exec grep -il /usr/java/jdk1.7.0_40 {} \;
./wlserver_10.3/.product.properties
./wlserver_10.3/common/nodemanager/nodemanager.properties
./coherence_3.7/.product.properties
Back up all above files and edit/replace the JAVA_HOME from old to new directory i.e from /usr/java/jdk1.7.0_40 to /u01/java/jdk1.7.0_171
In the case that you are using WLS 10.3.6 and the targetJDK is using a certified version of JAVA 7 (version 1.7.0_x) , you will need to copy manually some jar files:
[oracle@oel1]$ cd /u01/java/jdk1.7.0_171/jre/lib
[oracle@oel1]$ mkdir endorsed
[oracle@oel1]$ cd endorsed
[oracle@oel1]$ cp $MW_HOME/modules/javax.annotation_1.0.0.0_1-0.jar .
[oracle@oel1]$ cp $MW_HOME/modules/javax.xml.bind_2.1.1.jar .
[oracle@oel1]$ cp $MW_HOME/modules/javax.xml.ws_2.1.1.jar .
Start the processes