File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Newbie question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Newbie question" Watch "Newbie question" New topic
Author

Newbie question

Carlos Obregon
Greenhorn

Joined: May 26, 2009
Posts: 18
Hi!

I'm using this command line to compile a class:

javac -classpath "C:\Program Files\apache-tomcat-6.0.18\lib\servlet-api.jar" -d classes src/Test.java

Is this the corresponding build.xml:

<pre><?xml version="1.0" ?>
<project name="test" default="compile">
<target name="compile">
<javac classpath="C:\Program Files\apache-tomcat-6.0.18\bin\servlet-api.jar" srcdir="src" destdir="classes" />
</target>
</project></pre>

Thanks!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does it work when you run Ant?
Carlos Obregon
Greenhorn

Joined: May 26, 2009
Posts: 18
No it doesn't. It complains about not finding the classes from the package javax.servlet so I assumed that the attribute classpath is wrong.

Thanks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The first thing I'd try is using forward slashes in the Ant classpath attribute. I don't have access to a Windows machine at the moment to test, though.
 
 
subject: Newbie question
 
Similar Threads
How To Compile Servlet
Can't find package
Unable to complie
I'am need help on page.no 82 HFS
File not getting imported