I have a small script in rhel6 that basically goes like this:
#!/bin/bash
if [ "$JAVA_HOME" = "" ]; then
echo The environment variable JAVA_HOME is not set. Deploy failed.
exit 1
else
CLASSPATH=./lib/ant-nodeps.jar:./lib/ant.jar:./lib/ant-launcher.jar:./lib/tools.jar
#echo classpath: $CLASSPATH
"$JAVA_HOME/bin/java" -Dant.home=./ant org.apache.tools.ant.launch.Launcher -Dinstaller.requested=false -buildfile deploy.xml
fi
I have tried many things and i still get this launcher not found error. ant version -1.9.9
In .bash_profile
PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/jre/bin/:/opt/WebSphere/AppServer/java/bin:/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin:/root/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/bin/mozilla:/usr/bin/firefox:/usr/local/apache-ant-1.9.9/bin:/bin/bash:/usr/bin/java:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/jre/bin/:/opt/WebSphere/AppServer/java/bin:/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64/bin:/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin:/usr/local/apache-ant-1.9.9/lib/ant-launcher.jar
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.41.x86_64
ANT_HOME=/usr/local/apache-ant-1.9.9
I have also tried setting ANT_LIB in bash_profile but with no luck..What can i do next??
The error is : Error: Could not find or load main class org.apache.tools.ant.launch.Launcher