This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 18541
    
    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
 
Similar Threads
How to set Environment variable to set -Duser.timezone property for JVM?
Environmental Variable
problem while installing netbeans6
EE javac
problem while installing netbeans6.0