ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <>
Subject Re: searching help for: class org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter can not be found
Date Thu, 11 Oct 2007 14:01:20 GMT
On 10/11/07, Roland Piazzi <> wrote:
> I try to run the aspectj-compiler with ant but it gives me the following
> error:
> A class needed by class can not
> be found:
> org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter
> This class is contained within the file ant.jar which also is in a
> lib-folder which is added to the path.
> I don't know how to go on, hope that someone can help me about this?
> I attach my build file...
> build.xml

Sounds like a classloader issue (just a guess). You don't specify a
classpath when you taskdef Ajc, which implies that it's on the Java
classpath, while Ant's classes are loaded from a classloader "higher"
level classloader.

<taskdef name="ajc" classname="">

I thought Ant set the context class loader to its classloader, so Ajc
should be able to see the Ant classes... Are you sure you are not
mixing up several versions of Ant on the classpath?

Try running Ant with the switch to disables the use of a global
CLASSPATH, and explicitly tell Ant where the jar for Ajc is, either:
(1) in the taskdef, (2) via -lib on the command line, or (3) by
putting the jar in $ANT_HOME/lib. If none of these methods work,
that's a more difficult issue likely related to a bad classpath (or
issues in Ajc). --DD

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message