Total Pageviews

Sunday, August 31, 2014

ant command error linux. Could not find the main class: org.apache.tools.ant.launch.Launcher. Program will exit


Exception in thread "Main Thread" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launche                                                      r
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.tools.ant.launch.Launcher.  Program will exit.

above message is displaying when running ant command

solution:
check your ANT_HOME value it should be set and when setting up path please do not include /bin . it is rule when you setup path of any product, path goes until /bin but doest include bin in java


wrong example
echo $ANT_HOME
/opt/iam11122/middleware/modules/org.apache.ant_1.7.1/bin
correct example

echo $ANT_HOME
/opt/iam11122/middleware/modules/org.apache.ant_1.7.1

fix the path and rerun the command it should work now.

No comments:

Post a Comment