Reputation: 3911
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
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:
Servers
-> Application Servers
-> (Server_Name)
-> Process Definition
-> Java Virtual Machine
-> Additional Properties
-> Custom Properties
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