wood burning stoves 2.0*
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
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.
 
wood burning stoves
 
subject: Newbie question
 
Similar Threads
File not getting imported
How To Compile Servlet
I'am need help on page.no 82 HFS
Can't find package
Unable to complie