Bootstrap FreeKB - IBM WebSphere - Update all profiles to use a certain version of Java using the managesdk -enableProfileAll command
IBM WebSphere - Update all profiles to use a certain version of Java using the managesdk -enableProfileAll command

Updated:   |  IBM WebSphere articles

If you are not familiar with how WebSphere integrates with Java, refer to Getting Started with Java on WebSphere.

The managesdk.bat (Windows) or managesdk.sh (Linux) command with the -enableProfileAll and -sdkname options will update the commands, nodes and servers in all profiles to use a certain version of Java SDK. Or, -enableProfile can be used to update the commands, nodes and servers in a single profile to use a certain version of Java SDK.

Before updating the commands, nodes and servers in all profiles to use a certain version of Java SDK, you may want to use the -listEnabledProfileAll option to list the version of Java SDK being used by the commands, nodes and servers in all profiles. You will also want to stop the node servers, but the deployment manager will need to be running.

You will also want to use setNewProfileDefault so that new profiles use a certain version of Java SDK.

AVOID TROUBLE

If you are prompted for a username and password, refer to username password and the soap.client.props sas.client.props ipc.client.props files.

Let's say the managesdk command with the -listEnabledProfileAll option returns the following. Notice there are two profiles, and each profile has one command, one node, and two servers.

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

CWSDK1004I: Profile Profile01 :
CWSDK1006I: PROFILE_COMMAND_SDK = 1.7_64
CWSDK1008I: Node Node01 SDK name: 1.7_64
CWSDK1009I: Server AppSrv01 SDK name: 1.7_64
CWSDK1009I: Server AppSrv02 SDK name: 1.7_64

CWSDK1004I: Profile Profile02 :
CWSDK1006I: PROFILE_COMMAND_SDK = 1.7_64
CWSDK1008I: Node Node01 SDK name: 1.7_64
CWSDK1009I: Server AppSrv01 SDK name: 1.7_64
CWSDK1009I: Server AppSrv02 SDK name: 1.7_64

 

The managesdk command with the -listAvailable option can then be used to determine the versions of Java SDK that can be used.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listAvailable
CWSDK1003I: Available SDKs :
CWSDK1005I: SDK name: 1.7_64
CWSDK1005I: SDK name: 1.8_64
CWSDK1005I: SDK name: 1.8_64_bundled
CWSDK1001I: Successfully performed the requested managesdk task.

 

The managesdk command with the -enableProfileAll and -sdkname options will update the command and node in all profiles to use the version of Java SDK specified, but will not update the servers (e.g. the Application Servers).

AVOID TROUBLE

Before issuing the managesdk.sh -enableProfileAll -sdkname command, ensure the nodes are synchronized with the deployment manager.

${WAS_INSTALL_ROOT}/bin/managesdk.sh -enableProfileAll -sdkname 1.8_64

 

If the change is successful, the following should be displayed. Notice that the command and node were updated to use the versions of Java SDK that was specified but AppSrv01 and AppSrv02 were not updated to use the versions of Java SDK that was specified.

CWSDK1017I: Profile Profile01 now enabled to use SDK 1.8_64.
CWSDK1024I: The node default SDK setting for federated profile Profile01 has been saved in the master configuration repository.
CWSDK1025I: A synchronization operation is required before configuration changes to federated profile Profile01 can be used.
CWSDK1017I: Profile Profile01 now enabled to use SDK 1.8_64.

CWSDK1017I: Profile Profile02 now enabled to use SDK 1.8_64.
CWSDK1024I: The node default SDK setting for federated profile Profile02 has been saved in the master configuration repository.
CWSDK1025I: A synchronization operation is required before configuration changes to federated profile Profile02 can be used.
CWSDK1017I: Profile Profile02 now enabled to use SDK 1.8_64.

 

The -enableServers option must be included to update servers (e.g. the Application Servers) to use the versions of Java SDK that was specified.

AVOID TROUBLE

The node that contains the servers will need to be up and running. Also, if the node is federated into a deployment manager, the node agent will need to be up and running and the node agent will need to be synchronized with the deployment manager.

${WAS_INSTALL_ROOT}/bin/managesdk.sh -enableProfileAll -sdkname 1.8_64 -enableServers

 

The -listEnabledProfileAll option can then be used to verify that the commands, nodes and servers in all profiles are using the version of Java SDK that you specified.

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

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

CWSDK1004I: Profile Profile02 :
CWSDK1006I: PROFILE_COMMAND_SDK = 1.8_64
CWSDK1008I: Node Node01 SDK name: 1.8_64
CWSDK1009I: Server Server01 SDK name: 1.8_64
CWSDK1009I: Server Server02 SDK name: 1.8_64

 

When starting your WebSphere network deployment manager (dmgr), node, or application server, the HPEL or SystemOut log should contain something like this, where the Java version matches the Java version being returned by the managesdk command.

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

 




Did you find this article helpful?

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



Comments


Add a Comment


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