Code used to access the environemental variables which are well defined in the system properties of an unix system
export CLASSPATH=$CLASSPATH:./
export JAVA_HOME=/opt/java1.4/
export PATH=/opt/java1.4/jre/bin:$PATH
java -DASAP_BASE=$ASAP_BASE demoClass
public class demoClass { String Base; private void loadVariables() { Base = System.getProperty("COMP_BASE"); System.out.println(Base); } public static void main(String[] args){ demoClass a = new demoClass(); a.loadVariables(); } }
export CLASSPATH=$CLASSPATH:./
export JAVA_HOME=/opt/java1.4/
export PATH=/opt/java1.4/jre/bin:$PATH
java -DASAP_BASE=$ASAP_BASE demoClass