Problem with Ant runtime classpath
1 posts in topic
Flat View  Flat View

Posted By:   Leon_Pu
Posted On:   Tuesday, November 23, 2004 08:14 PM

My project uses Log4j and has passed compilation by Eclipse. When I try to use Ant to do the compile work, it failed with Log4j related classes can not be found exception. But I remmeber to put the log4j.jar to the classpath element in build file. While I put the log4j.jar into $ANT_HOME/lib, then the compile work under Ant passed.

It also encounter in using some third party jars like jdom.jar etc.. But not every library will encounter this kind of problem. Is it the bug of Ant?

Btw, the Ant I used is in version 1.6.2.

Re: Problem with Ant runtime classpath

Posted By:   Anonymous  
Posted On:   Wednesday, November 24, 2004 02:39 AM

No, it´s the bug of your buildfile :-)

Define a classpath holding all the JARs and refer to that. Don´t add external jars to $ANT_HOME/lib because its heavier to change the Ant version. You can put libs into $USER_HOME/.ant/lib (since 1.6 libs are picked up there). But I suggest putting them into a local lib-directory of your project and hold them in a CVS, because they are needed to a complete build.


| build.xml
| build.properties
+-- lib
| log4j.jar
| jdom.jar
+-- src

About | Sitemap | Contact