It's all about the answers!

Ask a question

Build error - java.lang.ClassNotFoundException:

Vijayalakshmie K Ekan (711115) | asked Nov 27 '14, 8:44 a.m.
While Request Build viaAnt Enterprise Extension  Rationa Build Agent , getting error java.lang.ClassNotFoundException:

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:
* Caused by: java.lang.ClassNotFoundException:
*     at
*     at java.lang.ClassLoader.loadClass(
*     at sun.misc.Launcher$AppClassLoader.loadClass(
*     at java.lang.ClassLoader.loadClass(
* Could not find the main class:  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.

Accepted answer

permanent link
Ryan Ruscett (1.0k413) | answered Nov 27 '14, 9:15 a.m.

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?


It's not able to find the class 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

One other answer

permanent link
Vijayalakshmie K Ekan (711115) | answered Dec 01 '14, 6:04 a.m.
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

Your answer

Register or to post your answer.