ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
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 <roland_piazzi@gmx.net> wrote:
> I try to run the aspectj-compiler with ant but it gives me the following
> error:
>
> A class needed by class org.aspectj.tools.ant.taskdefs.compilers.Ajc 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... http://www.nabble.com/file/p13155870/build.xml
> 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="org.aspectj.tools.ant.taskdefs.compilers.Ajc">
     </taskdef>

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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message