• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Is this the correct way to compile code that uses classes in another jar file

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<property name="source" value="."/>
<property name="lib" value="${source}/lib"/>
<property name="build" value="${source}/build"/>
<property name="config" value="${source}/config"/>
<property name="client" value="${source}/client"/>

<target name="compile">
<mkdir dir="${build}"/>
<mkdir dir="${client}"/>
<javac srcdir="${source}" destdir="${build}" includes="*.java">
<classpath>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>

I have my jar under the ./lib directory and
<echo>
${lib}
</echo>

outputs ./lib

Thanks for any help

Tony
 
Saloon Keeper
Posts: 28753
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's an excerpt from a real-world project:



I hope it's not too confusing - I ripped it out of a very large project, so there may be some strange references left in there.
 
reply
    Bookmark Topic Watch Topic
  • New Topic