Hi all,
Sometime it is required to switch JDK used by weblogic server for example from Sun to JRockit (which gives better performance). Another use case could be to switch from 32 to 64 bit JDK as well as latest supported JDK. To verify supported JDK version check Oracle FMW support matrix
In this post we will switch JDK from Sun to JRockit and i assume we are on Linux environment find same configuration file name with .CMD extension if you are on windows.
Installing new JDK:
First step is to install your desired JDK. Follow these steps to install
1. Download JRockit JDK from OTN
2. FTP the file to server and unzip it by running following command
3. The file will be extracted with .bin extension, change the permission and make it executable.
4. Install JRockit to your desired location (in my example i have xserver running).
Follow the wizard to complete the installation. I installed JRockit on /u01/Oracle/jrockit-r28.2.2
Changing Weblogic Configuration to use new JDK
1. Shutdown all managed servers in Weblogic domain
2. Backup the following files
3. Edit setDomain.env file and find ${JAVA_HOME}
Comment the JAVA_HOME entry
4. Add the following after this
5. Search the following section in the file, specifically for "-Djrockit.optfile":
Note: This parameter usually gives warning of being obsolete
you will find
remove the "-Djrockit.optfile" property:
6. Save the file
7. Edit commEnv.sh file, find the following section
8. Add the following line after above section
9. Start Admin Server and confirm your changes by running following command
Sometime it is required to switch JDK used by weblogic server for example from Sun to JRockit (which gives better performance). Another use case could be to switch from 32 to 64 bit JDK as well as latest supported JDK. To verify supported JDK version check Oracle FMW support matrix
In this post we will switch JDK from Sun to JRockit and i assume we are on Linux environment find same configuration file name with .CMD extension if you are on windows.
Installing new JDK:
First step is to install your desired JDK. Follow these steps to install
1. Download JRockit JDK from OTN
2. FTP the file to server and unzip it by running following command
$ unzip jrockit_282V30318-01.zip
3. The file will be extracted with .bin extension, change the permission and make it executable.
$ chmod 755 jrockit-jdk1.6.0_29-R28.2.2-4.1.0-linux-x64.bin
4. Install JRockit to your desired location (in my example i have xserver running).
Follow the wizard to complete the installation. I installed JRockit on /u01/Oracle/jrockit-r28.2.2
$ ./jrockit-jdk1.6.0_29-R28.2.2-4.1.0-linux-x64.bin
Changing Weblogic Configuration to use new JDK
1. Shutdown all managed servers in Weblogic domain
2. Backup the following files
$MW_HOME/user_projects/domains/<domain name>/bin/setDomainEnv.sh $WL_HOME/common/bin/commEnv.sh e.g. $ cd /u01/Oracle/Middleware/user_projects/domains/base_domain/bin $ cp setDomainEnv.sh setDomainEnv.sh.before_jdk_change $ cd /u01/Oracle/Middleware/wlserver_10.3/common/bin $ cp commEnv.sh commEnv.sh.before_jdk_change
3. Edit setDomain.env file and find ${JAVA_HOME}
Comment the JAVA_HOME entry
#JAVA_HOME="${JAVA_HOME}" #export JAVA_HOME
4. Add the following after this
# Added the following lines to change to JRockit JDK JAVA_HOME="/u01/Oracle/jrockit-r28.2.2" export JAVA_HOME JAVA_VENDOR="Oracle" export JAVA_VENDOR
5. Search the following section in the file, specifically for "-Djrockit.optfile":
Note: This parameter usually gives warning of being obsolete
you will find
EXTRA_JAVA_PROPERTIES="-Dcommon.components.home=${COMMON_COMPONENTS_HOME} -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=${DOMAIN_HOME} -Djrockit.optfile=${COMMON_COMPONENTS_HOME}/modules/oracle.jrf_11.1.1/jrocket_optfile.txt -Doracle.server.config.dir=${ORACLE_DOMAIN_CONFIG_DIR}/servers/${SERVER_NAME} -Doracle.domain.config.dir=${ORACLE_DOMAIN_CONFIG_DIR} ......"
remove the "-Djrockit.optfile" property:
-Djrockit.optfile=${COMMON_COMPONENTS_HOME}/modules/oracle.jrf_11.1.1/jrocket_optfile.txt
6. Save the file
7. Edit commEnv.sh file, find the following section
if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
8. Add the following line after above section
JAVA_HOME="/u01/Oracle/jrockit-r28.2.2" export JAVA_HOME JAVA_VENDOR="Oracle" export JAVA_VENDOR
9. Start Admin Server and confirm your changes by running following command
$ ps -ef | grep Admin
if you see something similar then your are good to start other managed servers
oracle 13927 13771 5 15:30 ? 00:03:58 /u01/Oracle/jrockit-r282.2/bin/java -jrockit -Xms2048m -Xmx2048m -Dweblogic.Name=AdminServer
Hope it help,
Zeeshan Baig
What I usually do is change the JAVA_HOME parameter .product_properties file located at $MW_HOME/wlserver_10.3 and $MW_HOME/coherence_10.3 into a location that I link to the JVM.
ReplyDeleteSo in your example my JAVA_HOME would be /u01/Oracle/java. That would be a symbolic link to /u01/Oracle/jrockit-r28.2.2 . So if you then upgrade java to a new version, you only have to change the symbolic link instead of having to fix all the files you mentioned.
Hi oraclemva,
ReplyDeleteThanks for nice tip.
ZB
Option "-Djrockit.optfile" was replaced with another option, allowing more control over optimization process, see
ReplyDeletehttp://docs.oracle.com/cd/E15289_01/doc.40/e15066/newchanged.htm#CHDGIDAF
and
http://docs.oracle.com/cd/E15289_01/doc.40/e15059/crash.htm#BABJGICB
Hi Zeeshan,
ReplyDeleteCould you please help me as I am stuck in mid after upgrading java32 bit to 64 bit and managed server is not coming up.
Thank you
J P Saha
Hi,
DeleteWhat exception is coming in the logs ?
Zeeshan
in this setDomainEnv.sh having Sun_java_home and Bea_java_home , which one have to add, please let me know
ReplyDeleteSUN_JAVA_HOME is Oracle Java JDK and BEA_JAVA_HOME is JROCKIT JDK you can set any one of it.
DeleteAny difference on installation of weblogic 9 and 10
ReplyDeleteNot much but version 10 has been here for a while I believe over 6 years now. It is always good to follow Installation documentation.
Deletehow to define in unicast first two servers can act as agroup leader
ReplyDeleteHi,
DeleteI have not done it before but you can find some detail here https://docs.oracle.com/middleware/1212/wls/CLUST/features.htm#CLUST127
Zeeshan