IBM WebSphere - Getting Started with Java

The imcl (Installation Manager command line tool) command with the listInstalledPackages -long option can be used to list the IBM packages that have been installed. In this example, the imcl command is located at /opt/IBM/InstallationManager/eclipse/tools/imcl but you may have the imcl command located at some other directory. In this example, Java version 8.0.6.25 is installed.

~]# /opt/IBM/InstallationManager/eclipse/tools/imcl listInstalledPackages -long
/opt/WebSphere/AppServer90 : com.ibm.java.jdk.v8_8.0.6025.20210115_1050 : IBM SDK, Java Technology Edition, Version 8 : 8.0.6.25
/opt/WebSphere/AppServer90 : com.ibm.websphere.ND.v90_9.0.5007.20210301_1241 : IBM WebSphere Application Server Network Deployment  : 9.0.5.7

 

If you need to identify the full build version of Java, the java command with the -version option can be used.

~]# ${WAS_INSTALL_ROOT}/java/bin/java -version   

java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 8.0.5.37 - pxa6480sr5fp37-20190618_01(SR5 FP37))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20190617_419755 (JIT enabled, AOT enabled)
OpenJ9   - 354b31d
OMR      - 0437c69
IBM      - 4972efe)
JCL - 20190606_01 based on Oracle jdk8u211-b25

 

And when starting your WebSphere network deployment manager, node, or application server, the HPEL or SystemOut.log should contain something like this.

Java version = 1.8.0_211, Java Runtime Version = 8.0.5.37 - pxa6480sr5fp37-20190618_01(SR5 FP37), Java Compiler = j9jit29, Java VM name = IBM J9 VM
Java Home = /opt/WebSphere/AppServer90/java/jre

 

And the managesdk -listAvailable command can be used.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listAvailable -verbose
CWSDK1003I: Available SDKs :
CWSDK1005I: SDK name: 1.8_64
 - com.ibm.websphere.sdk.location.1.8_64=${WAS_INSTALL_ROOT}/java

 


Installing a new version of Java

Refer to Install Java for WebSphere using imcl command to update Java to a new version. Let's say you were able to install version 8.0.7.0 of Java, which you can confirm by reissuing the the imcl command with the listInstalledPackages -long option.

~]# /opt/IBM/InstallationManager/eclipse/tools/imcl listInstalledPackages -long
/opt/WebSphere/AppServer90 : com.ibm.java.jdk.v8_8.0.7000.20211025_1430 : IBM SDK, Java Technology Edition, Version 8 : 8.0.7.0
/opt/WebSphere/AppServer90 : com.ibm.websphere.ND.v90_9.0.5007.20210301_1241 : IBM WebSphere Application Server Network Deployment  : 9.0.5.7

 


Setting the default Java version

The managesdk -listEnabledProfileAll command can be used to list the version of Java SDK being used by the profile, node, and servers. The managesdk -enableProfile command can be used to update a profile, node, and servers to use a certain version of Java SDK, and the managesdk -setNewProfileDefault command can be used to update a profile, node, and servers to use a certain version of Java SDK by default. 

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listEnabledProfileAll

CWSDK1004I: Profile Profile01 :
CWSDK1006I: PROFILE_COMMAND_SDK = 1.7_32
CWSDK1008I: Node Node01 SDK name: 1.7_32
CWSDK1009I: Server Server01 SDK name: 1.8_32
CWSDK1009I: Server Server02 SDK name: 1.8_32

 

The managesdk -getCommandDefaults command can be used to list the version of Java SDK that are being used by commands. The managesdk -setCommandDefaults command can be used to update commands to use a certain version of Java SDK by default. 

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -getCommandDefault
CWSDK1006I: COMMAND_DEFAULT_SDK: 1.7_64

 

AVOID TROUBLE

Certain versions of Java only support certain TLS protocols. For example, version 8.0.6.30 of Java does support version 1.2 of TLS but does not support versions 1.0 or 1.1 of TLS. You may need to update each WebSphere SSL configuration to use the supported version of TLS.

 


You may also want to:

 


SystemOut.log

After you restart the dmgr, node agent, or application server, Java version and Java Home in SystemOut.log should contain the version of Java being used (Java 8, 64-bit in this example).

Java version = 1.8.0
Java Home = ${WAS_INSTALL_ROOT}/java_1.8_64/jre

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter ccde1 in the box below so that we can be sure you are a human.