Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie question

 
Carlos Obregon
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it work when you run Ant?
 
Carlos Obregon
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic