Bootstrap FreeKB - IBM WebSphere - Update a profile to use a certain version of Java using the managesdk -enableProfile command
IBM WebSphere - Update a profile to use a certain version of Java using the managesdk -enableProfile 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 -enableProfile and -sdkname options will update the commands, nodes and servers in a single profile to use a certain version of Java SDK. Or, -enableProfileAll can be used to update the commands, nodes and servers in all profiles to use a certain version of Java SDK.

Before using the -enableProfile and -sdkname options to update the commands, nodes and servers in a single profile to use a certain version of Java SDK, you may want to use the -listEnabledProfile option to list the version of Java SDK being used by the commands, nodes and servers in a single profile.

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 -listEnabledProfile option returns the following. Notice there is one command, one node, and two servers.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listEnabledProfile -profileName Profile01

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

 

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 -enableProfile and -sdkname options will update the command and node in the specified profile 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 -enableProfile -profileName Profile01 -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.

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

 

The -enableServers option must be included to update 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 -enableProfile -profileName Profile01 -sdkname 1.8_64 -enableServers

 

The -listEnabledProfile option can then be used to list the version of Java being used by the profile.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listEnabledProfile -profileName Profile01
CWSDK1006I: PROFILE_COMMAND_SDK = 1.8_64
CWSDK1008I: Node Node01 SDK name: 1.8_64
CWSDK1009I: Server AppSrv01 SDK name: 1.8_64
CWSDK1009I: Server AppSrv02 SDK name: 1.8_64

 

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

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -listEnabledProfile -profileName Profile01
CWSDK1006I: PROFILE_COMMAND_SDK = 1.8_64
CWSDK1008I: Node Node01 SDK name: 1.8_64
CWSDK1009I: Server AppSrv01 SDK name: 1.8_64
CWSDK1009I: Server AppSrv02 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 8fd63d in the box below so that we can be sure you are a human.