• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create environmental variables in Websphere Application Server

 
sreenivas vemula
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,
Please provide information on how to create environment variables in websphere application server and retrieve the same from a java application.
I have following lines of code which is trying to fetch the value of environmental variable.
String environment = System.getProperty("policyService.environment");
actually this variable will decide the environment in which the code is deployed and will proceed accordingly.
When I try to print the value of the variable I am getting as null. Dont know whether this variable is environmental variable of websphere variable.

Please assist.

Regards,
sreeni.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the admin console:

Application servers -> (server name) -> Server Infrastructure, Java and Process Management, Process Definition -> Java Virtual Machine -> Custom Properties.

(The exact sequence may vary depending on what version of Websphere you are using.)

The entries you make here are system properties (not environment variables and not Websphere variables). They can be accessed via System.getProperty() as in your example.
 
sreenivas vemula
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Thanks a ton

Regards,
sreeni.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic