Results 1 to 3 of 3
Thread: Compile Servlets with Apache ANT
- 08-06-2009, 09:52 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 3
- Rep Power
- 0
Compile Servlets with Apache ANT
hy..
I have a problem with Apache Ant. I write a Servlet and now i want to compile it but I always get a cannot find symbol Class.java!
If i compile a normal Java Project everything goes right but not with the Servlet!? Does anybody knows if i have to do something else between compiling a Servlet or JAva Project? (build.xml?):confused:
thx
- 08-06-2009, 11:04 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Can you show us the code around where you're getting that error?
- 08-06-2009, 11:39 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 3
- Rep Power
- 0
This is the code of my build.xml:
The problem with the cannot find symbol is already solved! I forgot to set the classpath to my tomcat\lib!Java Code:<project name="MyTask" basedir="." default="Main"> <property name="src" location="src" /> <property name="build" location="build" /> <property name="dist" location="dist" /> <property name="docs" location="docs" /> <property name="tomcat.home" location="C:\xampp\tomcat" /> <target name="clean"> <delete dir="${build}" /> <delete dir="${docs}" /> <delete dir="${dist}" /> </target> <target name="makedir"> <mkdir dir="${build}" /> <mkdir dir="${docs}" /> <mkdir dir="${dist}" /> </target> <target name="compile" depends="clean, makedir"> <classpath> <fileset dir="${tomcat.home}\lib" includes="*.jar" /> </classpath> <javac srcdir="${src}" destdir="${build}" /> </target> <target name="jar" depends="compile"> <jar destfile="${dist}\test.jar" basedir="${build}"> <manifest> <attribute name="Main-Class" value="main.Main" /> </manifest> </jar> </target> <target name="Main" depends="compile, jar"> <description>Main target</description> </target> </project>
But after I did this I get another error now he tells me that:
Problem: failed to create task or type classpath
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Does this mean he can not resolve <classpath>? Because when I type it he doesn't give me any suggestions for classpath....:confused:
:)
Similar Threads
-
org.apache.jasper.JasperException: Unable to compile class for JSP:
By benperks in forum New To JavaReplies: 5Last Post: 11-20-2011, 09:22 PM -
org.apache.jasper.JasperException: Unable to compile class for JSP
By satya kishore in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 04-13-2010, 02:40 PM -
Servlets
By javahelp00 in forum New To JavaReplies: 1Last Post: 02-28-2009, 06:28 PM -
Apache Axis2 is built on Apache AXIOM, a new high performance, pull-based XML object.
By anusoniaa in forum XMLReplies: 0Last Post: 11-15-2008, 07:29 AM -
Servlets
By nagaroopanandha in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 02:09 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks