Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Build error - java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher

While Request Build viaAnt Enterprise Extension  Rationa Build Agent , getting error java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher

I am working with RTCz v 4.0.1 ( RTC on System z) ,
WAS v 8.5 where RTC applications deployed
Build Engine of type Rational Build Agnet
Build Definition - Ant Enterprise Extension Rationa Build Agent

While requesting Build getting :
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.tools.ant.launch.Launcher
* Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
*     at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
*     at java.lang.ClassLoader.loadClass(ClassLoader.java:677)
*     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
*     at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
* Could not find the main class: org.apache.tools.ant.launch.Launcher.  Program will exit.
EXEC end "/rtc4/usr/lpp/jazz/v4.0.1"@"S0W1"

I have set ANT_HOME as /rtc4/usr/lpp/jazz/v4.0.1/buildsystem/buildtoolkit and JAVA_HOME set properly.



0 votes


Accepted answer

Permanent link
Hello,

The fact that it is failing in the main thread. It's failing while loading up and launching ant. This tells me (my opinion) that ANT is not set properly. I see you set ANT_HOME to where you decompressed the ANT files? That may be correct, but have you tried adding  ${ANT_HOME}/bin  (Unix) or  %ANT_HOME%/bin  (Windows) into your PATH?

JAVA_HOME="xxx/xx/xx/xx"
ANT_HOME="/rtc4/usr/lpp/jazz/v4.0.1/buildsystem/buildtoolkit
PATH="$ANT_HOME/bin:$PATH"
	

It's not able to find the class org.apache.tools.ant.launch.Launcher which resides in the ant-launcher.jar. You Now, it's very unlikely that the ant-launcher.jar is missing a class. But you could expand it and check if the class if there. If the class is there, it's the classpath that needs adjusting. 

Could try ant --execdebug and see what the output is. Although, I have never used it.

Hope this helps.


Vijayalakshmie K Ekan selected this answer as the correct answer

1 vote


One other answer

Permanent link
Hi Ryan,

  I could resolve this issue, Thanks for suggestion.

I haven't included PATH, and I am working with System z ,
So i just manually searched on the .jar file correct location and then it had lib and bin.

So gave that path as ANT_HOME, now it is proceeding with compile.

Thanks, Viji

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 382

Question asked: Nov 27 '14, 8:44 a.m.

Question was seen: 34,754 times

Last updated: Dec 01 '14, 6:04 a.m.

Confirmation Cancel Confirm