cancel
Showing results for 
Search instead for 
Did you mean: 

Java and UNIX environment variables

Former Member
0 Kudos

Hi folks,

am I right when I say that it is not possible to access UNIX environment variables from Java (these ones delared by the export statement)?

Cheers,

Heiko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

yes you are right. Java is platform independend and therefor there is no way to access theses environment variables. As a workaround you can get the environment variables by executing a unix command with the exec() method. This is of course not very elegant.

regards

Sebastian

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes.. Since some OS do not have the concept of environment variables,it is directly not possible.

But using the method System.getProperties you can get

some inf about the environment.

the following links may be of some help to you

http://www.javaworld.com/javaworld/javaqa/2001-07/01-qa-0706-env.html

http://www.jguru.com/faq/view.jsp?EID=11422