WAS v8.5 > Reference > Commands (wsadmin scripting)AdminSDKCmds command group for AdminTask
We can use commands and parameters in the AdminSDKCmds group in the Jython or Jacl scripting languages to manage software development kit configurations.
Using the commands and parameters in the AdminSDKCmds group for AdminTask, we can see what software development kits are not used by a node, get or set the default software development kit (SDK) for a node, and get or set an SDK for a server.
The AdminSDKCmds command group for AdminTask includes the following commands:
Every WebSphere Application Server version and operating system has a default SDK. For example, the default SDK for WAS v8 on workstations might be 1.6_32 for 32-bit operating systems and 1.6_64 for 64-bit operating systems. The name of an SDK that is installed at a particular computer location must be unique. On workstations, the default SDK is installed in a directory name that starts with ${WAS_HOME}/java for both 32- and 64-bit operating systems; for example, ${WAS_HOME}/java, ${WAS_HOME}/java_1.6_32, or ${WAS_HOME}/java_1.6_64.
The AdminSDKCmds wsadmin commands pertain to SDKs used by nodes or servers. To list and change the default SDK for a profile, use the managesdk command-line utility.
getNodeDefaultSDK
Use the getNodeDefaultSDK command to return the values of the default SDK for a node. The returned values include the Java home and SDK name.
Target object
None
Required parameters
- -nodeName
- Name of the node whose default SDK values you want returned. (String, required)
Optional parameters
None
- Jacl:
$AdminTask getNodeDefaultSDK {-nodeName myNode}
- Jython string:
AdminTask.getNodeDefaultSDK('[-nodeName myNode]')
- Jython list:
AdminTask.getNodeDefaultSDK(['-nodeName', 'myNode'])
Interactive mode example usage
- Jacl:
$AdminTask getNodeDefaultSDK {-interactive}
- Using Jython:
AdminTask.getNodeDefaultSDK('[-interactive]')
getSDKVersion
Run the getSDKVersion command to return the version number of the software development kit in use.
Target object
None
Required parameters
None
Optional parameters
- -nodeName
- Name of the node whose SDK version you want returned. Do not specify a -clusterName value with a -nodeName value. (String, optional)
- -serverName
- Name of the server whose SDK version you want returned. If we specify a -serverName value, specify a -nodeName value as well and do not specify a -clusterName value. (String, optional)
- -clusterName
- Name of the cluster whose SDK version you want returned. If we specify a -clusterName value, do not specify a -nodeName or -serverName value. (String, optional)
- -highest
- Whether to return the highest SDK version number. By default, the lowest SDK version number is returned. (Boolean, optional)
Batch mode example usage
- Jacl:
$AdminTask getSDKVersion {-nodeName myNode -serverName myServer}
- Jython string:
AdminTask.getSDKVersion('[-nodeName myNode -serverName myServer]')
- Jython list:
AdminTask.getSDKVersion(['-nodeName', 'myNode', ' -serverName', 'myServer'])
Interactive mode example usage
- Jacl:
$AdminTask getSDKVersion {-interactive}
- Using Jython:
AdminTask.getSDKVersion('[-interactive]')
getServerSDK
Use the getServerSDK command to return the values of the software development kit for a server. If a valid SDK value is set for the server, the returned values include the Java home and SDK name of the default SDK for the server.
If no SDK value is set for the server, the command returns nothing for the Java home value because a variables.xml file does not exist for the server or a JAVA_HOME entry does not exist in the variables.xml file. For the SDK name value, the command returns the node SDK name because the node SDK is the default SDK for a server when a valid SDK has not yet been set using the setServerSDK command.
Target object
None
Required parameters
- -nodeName
- Name of the node on which the server runs. (String, required)
- -serverName
- Name of the server whose SDK values you want returned. (String, required)
Optional parameters
- -checkOnly
- Whether to check only the variable. (Boolean, optional)
Batch mode example usage
- Jacl:
$AdminTask getServerSDK {-nodeName myNode -serverName myServer}
- Jython string:
AdminTask.getServerSDK('[-nodeName myNode -serverName myServer]')
- Jython list:
AdminTask.getServerSDK(['-nodeName', 'myNode', '–serverName', 'myServer'])
Interactive mode example usage
- Jacl:
$AdminTask getServerSDK {-interactive}
- Using Jython:
AdminTask.getServerSDK('[-interactive]')
getUnusedSDKsOnNode
Run the getUnusedSDKsOnNode command to return a list of the names of software development kits that a node is not using.
Target object
None
Required parameters
- -nodeName
- Name of the node whose unused SDK names you want returned. (String, required)
Optional parameters
None
- Jacl:
$AdminTask getUnusedSDKsOnNode {-nodeName myNode}
- Jython string:
AdminTask.getUnusedSDKsOnNode('[-nodeName myNode]')
- Jython list:
AdminTask.getUnusedSDKsOnNode(['-nodeName', 'myNode'])
Interactive mode example usage
- Jacl:
$AdminTask getUnusedSDKsOnNode {-interactive}
- Using Jython:
AdminTask.getUnusedSDKsOnNode('[-interactive]')
setNodeDefaultSDK
Use the setNodeDefaultSDK command to assign a default software development kit for a node. For the command, specify either the SDK Java home or the SDK name, but not both.
If you change the node SDK, ensure the options and properties for the Java command are compatible with the new SDK. See Configuring the JVM.
Target object
None
Required parameters
- -nodeName
- Name of the node for which to set a default SDK. (String, required)
Optional parameters
To set a node default SDK, specify the required -nodeName parameter with either -javahome or -sdkName. Both the -javahome and -sdkName parameters are optional but specify either one of the parameters.
To clear all SDK settings for all servers on a node, specify the required -nodeName parameter with either -javahome or -sdkName and with the optional -clearServerSDKs parameter set to true.
- -javahome
- Specifies the Java home of the SDK you want the node to use. If we specify a -javahome value, do not specify a value for the -sdkName parameter. (String, optional)
- -sdkName
- Name of the SDK you want the node to use. If we specify a value for this -sdkName parameter, do not specify a value for the -javahome parameter. (String, optional)
- -clearServerSDKs
- Specifies to clear any SDK value settings for all servers on a node. (Boolean, optional)
To clear SDK value settings for all servers on a node, specify true for -clearServerSDKs. After the server SDK value settings are cleared, servers use the SDK value setting for the node.
Batch mode example usage
- Jacl:
$AdminTask setNodeDefaultSDK {-nodeName myNode -sdkName 1.6_32}
$AdminTask setNodeDefaultSDK {-nodeName myNode -sdkName 1.6_32 -clearServerSDKs true}
- Jython string:
AdminTask.setNodeDefaultSDK('[-nodeName myNode -sdkName 1.6_32]')
AdminTask.setNodeDefaultSDK('[-nodeName myNode -sdkName 1.6_32 -clearServerSDKs true]')
- Jython list:
AdminTask.setNodeDefaultSDK(['-nodeName', 'myNode', '-javahome', '${JAVA_LOCATION_1.6_32}'])
AdminTask.setNodeDefaultSDK(['-nodeName', 'myNode', '-sdkName', '1.6_32', '-clearServerSDKs', 'true'])
Interactive mode example usage
- Jacl:
$AdminTask setNodeDefaultSDK {-interactive}
- Using Jython:
AdminTask.setNodeDefaultSDK('[-interactive]')
setServerSDK
Use the setServerSDK command to assign a software development kit for a server. The command creates a variables.xml file for the server that designates the SDK. For the command, specify either the cluster or both the node and server. Optionally specify either the SDK Java home or the SDK name, but not both.
To clear the server SDK assignment, do not specify values for SDK Java home or the SDK name. For example, if server1 is assigned SDK 1.6_32, run setServerSDK without the -javahome and -sdkName parameters to have no SDK assigned for server1.
If you change the server SDK, ensure the options and properties for the Java command are compatible with the new SDK. See Configuring the JVM.
Target object
None
Required parameters
None
Optional parameters
- -nodeName
- Name of the node on which the server runs. If we specify a -nodeName value, specify a -serverName value as well and do not specify a -clusterName value. (String, optional)
- -serverName
- Name of the server for which to set an SDK. If we specify a -serverName value, specify a -nodeName value as well and do not specify a -clusterName value. (String, optional)
- -clusterName
- Name of the cluster for which to set an SDK. When the parameter is specified, the cluster member template for the cluster is also set to use the new SDK name or SDK Java home. Any subsequent cluster member created in the cluster uses the new SDK name or Java home. If we specify a -clusterName value, do not specify a -nodeName or -serverName value. (String, optional)
- -javahome
- Specifies the Java home of the SDK you want the server to use. If we specify a -javahome value, do not specify a value for the -sdkName parameter. (String, optional)
- -sdkName
- Name of the SDK you want the server to use. If we specify a value for this -sdkName parameter, do not specify a value for the -javahome parameter. (String, optional)
Batch mode example usage
- Jacl:
$AdminTask setServerSDK {-nodeName myNode -serverName myServer -sdkName 1.6_32}
- Jython string:
AdminTask.setServerSDK('[-nodeName myNode -serverName myServer -sdkName 1.6_32]')
- Jython list:
AdminTask.setServerSDK(['-nodeName', 'myNode', '–serverName', 'myServer', '-javahome', '${JAVA_LOCATION_1.6_32}'])
Interactive mode example usage
- Jacl:
$AdminTask setServerSDK {-interactive}
- Using Jython:
AdminTask.setServerSDK('[-interactive]')
Related
Use the wsadmin scripting AdminTask object for scripted administration
Configure the JVM
Reference:
ManagedObjectMetadata command group for AdminTask
Commands for AdminTask using wsadmin.sh
managesdk command