Tuesday, October 25, 2011

How to Set JAVA_HOME, PATH and CLASSPATH for Java in Linux

Edit the /etc/profile file,
vi /etc/profile

add the following lines,

export JAVA_HOME=/u01/Oracle/Middleware/jdk160_24/


export PATH=$PATH:/u01/Oracle/Middleware/jdk160_24/bin

export CLASSPATH=$CLASSPATH:/home/oracle/Desktop/SendRemainder/lib/activation.jar:/home/oracle/Desktop/SendRemainder/lib/commons-codec.jar:/home/oracle/Desktop/SendRemainder/lib/commons-httpclient-3.0.1.jar:/home/oracle/Desktop/SendRemainder/lib/commons-logging.jar:/home/oracle/Desktop/SendRemainder/lib/mail.jar:/home/oracle/Desktop/SendRemainder/lib/oracle-ridc-client-10g.jar

Save the file and close it.

pause - equivalen command in linux (for reading the key from keyboard) --> read -p "press any key to exit"

1 comment: