ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gresh <>
Subject Classpaths in build file not working properly
Date Tue, 12 Jun 2007 19:28:29 GMT

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:
For additional commands, e-mail:

View raw message