akaliza
akaliza

Reputation: 3911

in Websphere, I am unable to get my JVM variables

In my websphere console, I am setting JVM variable (-Dval=true for example) and I am trying to get it from the java by doing this :

System.getProperty("val")

However ma variable is null, what am I doing wrong ?

regards,

Upvotes: 2

Views: 3946

Answers (1)

DanielBarbarian
DanielBarbarian

Reputation: 5333

You are not saying exactly which version of WAS you are using, but setting your own custom jvm properties can be done separately.

Follow the following navigation in your admin console. If it is not the same as in your version it should be very similar:

  • In WAS 6.1: Navigate to Servers -> Application Servers -> (Server_Name) -> Process Definition -> Java Virtual Machine -> Additional Properties -> Custom Properties
  • In WAS 8.5: Navigate to Servers > Server Types -> WebSphere application servers -> (Server_Name) -> Server Infrastructure -> Java and process management -> Process definition -> Java virtual machine -> Custom properties

If you use those steps to set your properties you should be able to use System.getProperty as you have described.

Upvotes: 5

Related Questions