I have done what you had said and modified my script as follows.
#Executing the payment extraction program
export SHLIB_PATH=/oracle/app/oracle/product/8.1.7/lib
export LD_LIBRARY_PATH=/oracle/app/oracle/product/8.1.7/lib
JAVA_HOME=/opt/java1.2
CLASSPATH="$JAVA_HOME"/lib/tools.jar:/oracle/app/oracle/product/8.1.7/jdbc/lib/classes12.zip
export JAVA_HOME CLASSPATH
export ORACLE_HOME=/oracle/app/oracle/product/8.1.7
cd /expbackup/ismspay/franchise/pihextraction
echo $JAVA_HOME
echo $CLASSPATH
$JAVA_HOME/bin/java Vishnu
~
But even now when I run the script I am getting the following error
Exception in
thread "main" java.lang.NoClassDefFoundError: Vishnu
But when I run the same class file in the command prompt, I am able to execute the same.