-1

I have a java project. The project references a shared library that I do not wish to be exported with the package I build. The share library is a jar file located in a folder in my project.

The src in the project refers to this shared library. When I attempt to build using ant, javac fails to link the references to the shared library, suggesting the library is not included in the classpath.

Can anybody tell me how I can include the classpath without moving the library into my libs folder? IF I move it into my libs folder, I presume it will be exported.

MM.
  • 4,224
  • 5
  • 37
  • 74

1 Answers1

1
<classpath>
      <pathelement path="${classpath}"/>
      <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
      <pathelement location="classes"/>
      <dirset dir="${build.dir}">
        <include name="apps/**/classes"/>
        <exclude name="apps/**/*Test*"/>
      </dirset>
      <filelist refid="third-party_jars"/>
</classpath>

Ant Documentation Tutorials

You can add the classpath element to add the library in classpath element

Narendra Pathai
  • 41,187
  • 18
  • 82
  • 120