Search code examples
javawebsphere

Finding the websphere version in java application


Its very common question to find the java version installed on the websphere, but how do we find the websphere version itself from an java application? My java application exists on the same server, please help.

I am aware of solution to add the version as the enviroment variable and reading it an app. But I am looking for a solution where in we don't have to add anything to WAS.


Solution

  • Use the Server MBean to programatically access product version information within your deployed application. The serverVersion attribute will provide the information you need and then some. Within a scripting environment you have a couple options involving wsadmin objects: Use the AdminTask object to access the serverVersion attribute of the server MBean; or, use the AdminControl.getNodeBaseProductVersion command. Finally, from the command line use the versionInfo command. -Regards.