|
Subject:
|
how to get env variable values?
|
|
Posted By:
|
suri
|
Post Date:
|
8/6/2003 2:57:02 PM
|
Hi all
Can any one tell me how to get the environment variable in java from the unix box??
thanks in-advance suri
|
|
Reply By:
|
yasir_lahham
|
Reply Date:
|
9/20/2003 5:34:28 PM
|
try this code, it should print the property name= value
import java.util.Enumeration;
public class Sys {
public static void main(String[] args) { Enumeration enm=System.getProperties().keys(); while (enm.hasMoreElements()){ String prop=enm.nextElement().toString(); System.out.println(prop.concat("= "+System.getProperties().getProperty(prop))); } } }
MHD Yasir Al-lahham
|