Each and every unix system have differenet host names for this smtp mail server connections. And this code used to dynamically fetch the values.
export CLASSPATH=$CLASSPATH:./
export JAVA_HOME=/opt/java1.4/
export PATH=/opt/java1.4/jre/bin:$PATH
HOST_NAME=$(uname -n)
java -DASAP_BASE=$ASAP_BASE -DHOST_NAME=$HOST_NAME demoClass
public class demoClass { String Base; String Host; private void loadVariables() { Base = System.getProperty("COMP_BASE"); Host = System.getProperty("HOST_NAME"); System.out.println(Base); System.out.println(Host); } 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
HOST_NAME=$(uname -n)
java -DASAP_BASE=$ASAP_BASE -DHOST_NAME=$HOST_NAME demoClass