Open JDK Changes - OIM-11g/12c

Download the Open-JDK from below site:

JDK-8: for OIM-12c
https://adoptium.net/temurin/archive/?version=8

JDK-7: for OIM-11g
https://jdk.java.net/java-se-ri/7

https://download.java.net/openjdk/jdk7u75/ri/jdk_ri-7u75-b13-linux-x64-18_dec_2014.tar.gz


Updating existing JDK path in OIM installed directory:

1. First Stop the Admin, SOA and OIM server
2. Download the required JDK version from above mentioned URL. In below steps just replace the respective JDK paths as per environment like 11g(JDK-7) or 12c(JDK-8).
3. Identify the existing JDK path and version on VM by using below commands.

$ whereis java
java: /usr/bin/java /usr/java/jdk1.8.0_291-amd64/bin/java /usr/share/man/man1/java.1

$ which java
/usr/java/jdk1.8.0_291-amd64/bin/java

$ java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

4. Navigate to below oracle home path to cross check on exact JDK path: e.g.
/home/oracle/Oracle/Middleware/Oracle_Home/oui/bin
Open the file “setProperty.sh” and check for “JAVA_HOME_LOCATION”, You can see the JDK home path as “/usr/java/jdk1.8.0_291-amd64”

5. Copy and take a backup of existing oracle home path
cp -r Oracle Oracle_BKP

6. Find the whole occurrence of existing JDK path using below command in main home path, not on backup path: Change JDK path as per your environment details
find . -type f -exec grep -i -l -n "/usr/java/jdk1.8.0_291-amd64" \{\} \;

*Note: Extract the output in notepad for above command as a reference to cross check what all files having JDK ref.

7. Now download the Open JDK from site link: https://adoptium.net/temurin/archive/?version=8
After download the file successfully, it looks like as “OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz”, Copy it in VM where you’re going to update the path. Run below commands from “root” user to set new JDK path
$ tar -zxf OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz

$ sudo mv jdk8u362-b09/ /usr/java

## Remove the old existing alternative path, if required
$ sudo update-alternatives --remove-all java
$ sudo update-alternatives --remove-all jar
$ sudo update-alternatives --remove-all javac
$ sudo update-alternatives --remove-all javaws


## Next, use command update-alternatives to tell system where java and its executables are installed:
$ sudo alternatives --install /usr/bin/java java /usr/java/jdk8u362-b09/bin/java 2
$ sudo alternatives --install /usr/bin/jar jar /usr/java/jdk8u362-b09/bin/jar 2
$ sudo alternatives --install /usr/bin/javac javac /usr/java/jdk8u362-b09/bin/javac 2
$ sudo alternatives --install /usr/bin/javaws javaws /usr/java/jdk8u362-b09/bin/javaws 2

## Then confirm that correct alternatives are in play:
$ sudo update-alternatives --config java
$ sudo update-alternatives --config jar
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws

8. Take new path setup on user binaries path “/usr/java/jdk8u362-b09”
## Run below command to change all the occurrence recursively
grep -rl 'jdk1.8.0_291-amd64' * | xargs sed -i 's/jdk1.8.0_291-amd64/jdk8u362-b09/g'

## Fine all the occurrence post changes
find . -type f -exec grep -i -l -n "/usr/java/jdk8u362-b09" \{\} \;

*Note: Extract the output in notepad for above command as a reference to cross check what all files having new JDK ref.

9. Change the environment variable of JAVA_HOME path in “.bash_profile” to pick up new open JDK path


Post changes - sanity check

Finally, you can start the Admin, SOA and OIM server in sequence. There should not be any error during startup. If you observe the startup logs, then you can see below information. Its picked up the new OpenJDK version.
<Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with OpenJDK 64-Bit Server VM Version 25.362-b09 from Temurin.>

Comments

Popular posts from this blog

PUTTY - The server's host key is not cached in the registry cache

OIM-12c Installation - FMW - SOA - IDM

SAML & OAuth 2.0