Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Classpaths in build file not working properly

Classpaths in build file not working properly

2007-06-12       - By Daniel Gresh


I have a build file, and in that build file I'm setting up my classpath
and assigning it. However, when I try to run my compiled code, I get a
NoClassDefFoundError: service/ImageProcessor.

When I run my code and set the classpath manually using the -cp argument
to the java command, the program executes fine. Here is the command I
use that works:

java -cp

*Note: service/ImageProcessor's full path is:

In my buildfile, here is the code I use to set up my classpath:

   <!-- Define the Java classpath -->
   <path id="classpath">
       <pathelement location="." />
location="${CATALINA_HOME}/webapps/kdb/WEB-INF/classes" />
       <pathelement location="/u/dgresh/Ice-3.1.0/lib/Ice.jar" />

I know $CATALINA_HOME is correct, as I use it with the ant reload
argument to reload my web app on Tomcat. Here is how I compile the code:

   <!-- Compile the Java code -->
   <target name="compile" depends="init">
       <javac srcdir="${src}" destdir="${build}/LOTFVigra" source="1.4"
           <classpath refid="classpath" />

As you can see, the two classpaths are identical. I have no idea what is
causing this problem.

Does anyone have any advice?


To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.