Ant Javac and Commandline Javac give different results

I have a class that imports some servlet libraries. When I compile it from the command line, this is normal.

When I use the ant compilation task to compile it, it gives errors that it cannot find the servlet libraries in its path.

Is this a known / common occurrence?

Here is my ant target:

<target name="compile" depends="prepare" description="compile the source" >
    <echo>=== COMPILE === SRCDIR: ${src}/com/udfr/src/java </echo> <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}/com/udfr/src/java" destdir="${dist}/WEB-INF/classes"/>
</target>
+1
source share
2 answers

This is a common occurrence if you incorrectly specified servlet libraries in the classpath for the task javac... I suspect a problem. If you post a failed job and a command line that will work, we can help more.

+2
source

- JAR , Servlet API, . javac Ant.

JAR javac Ant. ; , http://ant.apache.org/manual/Tasks/javac.html

+2

All Articles