Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java Language
Expertise: Beginner
May 31, 1998

Environment Variables

Question:
How do I access environment variables?

Answer:
There is an undocumented method in java.lang.System with the signature:

public static String getenv(String)
You can use this method to fetch the string values of environment variables. However, this method is deprecated and will surely soon disappear because not all platforms support the concept of environment variables. Instead, you should pass environment variable values using the -D flag to the java runtime and access them with the getProperty() method in the System class.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date