File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes How to create environmental variables in Websphere Application Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to create environmental variables in Websphere Application Server" Watch "How to create environmental variables in Websphere Application Server" New topic
Author

How to create environmental variables in Websphere Application Server

sreenivas vemula
Ranch Hand

Joined: Jan 21, 2012
Posts: 44

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
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Jan 21, 2012
Posts: 44
Hi Paul,
Thanks a ton

Regards,
sreeni.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create environmental variables in Websphere Application Server