ant-user mailing list archives

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

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 
/u/dgresh/Ice-3.1.0/lib/Ice.jar:.:$CATALINA_HOME/webapps/kdb/WEB-INF/classes 
vigra.ice.LOTFClient

*Note: service/ImageProcessor's full path is: 
$CATALINA_HOME/webapps/kdb/WEB-INF/classes/service/ImageProcessor.

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

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

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" 
target="1.4">
            <classpath refid="classpath" />
        </javac>
    </target>

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

Does anyone have any advice?

Thanks,
Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message