Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newb needs help

Status
Not open for further replies.

msloan

Programmer
May 30, 2001
39
US
Ok have just started using Ant (1 day) and am trying to compile a simple (I thought) servlet. I have my build file and when I execute ant from the command line, the compile fails, saying my package (that I am importing) does not exist.

I am assuming that I need to reference the library in the <javac> line of my build file, but I am not exactly sure how to do this.

Thanks in advance.

Matt
 
You can use <path> to define class path. Example:

Code:
<property name=&quot;lib&quot; location=&quot;webapp/WEB-INF/lib&quot;/>
<property name=&quot;classes&quot; location=&quot;webapp/WEB-INF/classes&quot;/>

<path id=&quot;classpath&quot;>
   <fileset dir=&quot;${lib}&quot;>
      <include name=&quot;**/*.jar&quot;/>
   </fileset>
</path>

<target name=&quot;compile&quot; description=&quot;compile the source &quot;>
   <javac srcdir=&quot;${src}&quot; destdir=&quot;${classes}&quot; classpathref=&quot;classpath&quot;/>
</target>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top