Bootstrap FreeKB - IBM WebSphere - Resolve "setupsdk No such file or directory"
IBM WebSphere - Resolve "setupsdk No such file or directory"

Updated:   |  IBM WebSphere articles

Let's say something like this is being returned when attempting to use the managesdk.sh script (on Linux).

/opt/WebSphere/AppServer/bin/sdk/_setupSdk.sh: line 36: /opt/WebSphere/AppServer/bin/sdk/_setupsdk1.8_64.sh: No such file or directory

 

You can list the contents of the /opt/WebSphere/AppServer/bin/sdk directory to see that the shell script (_setupsdk1.8_64.sh in this example) indeed does not exist.

~]$ ls -l /opt/WebSphere/AppServer85.64/bin/sdk
-rwxrwxr-x. 1 root root 4630 Jan 16  2021 _setupDefaultSDK.sh
-rwxrwxr-x. 1 root root 3593 Jan 16  2021 setupProfileSDK.sh
-rwxrwxr-x. 1 root root   95 Jan 18  2022 _setupsdk1.8_64_bundled.sh
-rwxrwxr-x. 1 root root 1144 Jun 20 22:41 _setupSdk.sh

 

This probably means that one or more profiles or command were configured to use a certain version of Java (1.8_64 in this example) and the version of Java was uninstalled before the profiles or command were configured to use a different version of Java. The imcl (Installation Manager command line tool) with the listInstalledPackages -long option can be used to display the currently installed packages. Notice in this example that there is no package for Java 1.8_64. In this scenario, Java 1.8_64_bundled is included with the IBM WebSphere Application Server Network Deployment : 8.5.5.19 package.

~]$ /opt/WebSphere/InstallationManager/eclipse/tools/imcl listInstalledPackages -long
/opt/WebSphere/InstallationManager/eclipse : com.ibm.cic.agent_1.9.1000.20191001_1228 : IBM® Installation Manager : 1.9.1
/opt/WebSphere/AppServer : com.ibm.websphere.ND.v85_8.5.5019.20210118_0346 : IBM WebSphere Application Server Network Deployment : 8.5.5.19

 


Update cmdDefaultSDK.properties and newProfileDefaultSDK.properties

On a Linux system, you can use the find command to determine the location of the cmdDefaultSDK.properties and newProfileDefaultSDK.properties files.

find /opt/WebSphere | egrep -i 'cmdDefaultSDK.properties|newProfileDefaultSDK.properties'

 

In this scenario, you would back up the following files and then update the following files to contain the Java version you want to use, such as 1.8_64_bundled.

  • /opt/WebSphere/AppServer/properties/sdk/cmdDefaultSDK.properties
  • /opt/WebSphere/AppServer/properties/sdk/newProfileDefaultSDK.properties

 


Check PROFILE_COMMAND_SDK in _setupSdk.sh

The _setupSdk.sh script may contain a line like this.

PROFILE_COMMAND_SDK=1.8_64

 

If _setupSdk.sh has the wrong version of Java SDK, update PROFILE_COMMAND_SDK in _setupSdk.sh to have the correct version of Java.

AVOID TROUBLE

Be aware that there may be two different directories that contain the _setupSdk.sh.

  • /opt/WebSphere/AppServer/bin/sdk/_setupSdk.sh
  • /opt/WebSphere/AppServer/profiles/your_profile/bin/sdk/_setupSdk.sh

 

Once _setupSdk.sh has been updated to have the correct version of Java SDK, the managesdk.sh -listAvailable command should no longer return the error and the currently installed versions of Java SDK (1.8_64_bundled in this example) should be returned.

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

 

And the managesdk.sh -getCommandDefault command should return the version of Java SDK that commands will use by default.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -getCommandDefault
CWSDK1006I: COMMAND_DEFAULT_SDK = 1.8_64_bundled 
CWSDK1001I: Successfully performed the requested managesdk task

 

And the managesdk.sh -getNewProfileDefault command should return the version of Java SDK that new profiles will use by default.

~]# ${WAS_INSTALL_ROOT}/bin/managesdk.sh -getNewProfileDefault
CWSDK1007I: New profile creation SDK name: 1.8_64_bundled
CWSDK1001I: Successfully performed the requested managesdk task.

 

And the managesdk.sh -listEnabledProfileAll command should return the version of Java SDK that profiles are using.

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

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



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 8f5899 in the box below so that we can be sure you are a human.