I wrote a simple Linux Script this way
export JAVA_HOME=/usr/local/jdk1.6.0_20
export PATH=/usr/local/jdk1.6.0_20/bin
LIB_DIR=/home/praveen/lib
export CLASSPATH=.:$LIB_DIR/commons-logging-1.0.4.jar:$LIB_DIR/log4j-1.2.8.jar
java -cp $CLASSPATH com.test.Sample
===============================================================================
The above script was working fine .
But when i tried for the first time with this , it was giving an error
export JAVA_HOME=/usr/local/jdk1.6.0_20
export PATH=/usr/local/jdk1.6.0_20/bin
export CLASSPATH = /home/praveen/lib/commons-logging-1.0.4.jar: /home/praveen/lib/log4j-1.2.8.jar
java -cp $CLASSPATH com.test.Sample
As you can observe the only difference between these two scripts is that , in the below script on to the class path , i am not including the current directory path ( .)
Please let me know , why this will not work this way ??