ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Pu <>
Subject Confusion of jar in Ant's classpath and system's CLASSPATH
Date Tue, 29 Nov 2005 15:18:54 GMT
Hi all,

I met a very strange problem that one jar doesn't become useful after I
put it to Ant classpath setting, ClassNotFoundException will be thrown
out. After I put the jar to system's CLASSPATH, Ant target runs without

The cannot be found java class in the special jar is not directly used
by my program, it is invoked by the java class which locate in other

Here is the sample classpath declaration in my build script. Class extends, it is included
in 1-1.jar. The ClassNotFound class is located in 2-1.jar which will be
invoked by the class in 3-1.jar.

  <path id="run.class.path">
    <pathelement location="${}" />
    <fileset dir="${internals.lib.dir}/component1">
      <include name="**/1-1.jar" />
    <fileset dir="${internals.lib.dir}/component2">
      <include name="**/2-1.jar" />
    <fileset dir="${internals.lib.dir}/component3">
      <include name="**/3-1.jar" />

  <property name="run.class.path" refid="run.class.path" />

  <target name="run.task">
    <taskdef name="mytask" classname=""
classpath="${run.class.path}" />
    <mytask arg1="${arg1}" arg2="${arg2}" />

Best regards,

Yahoo! Mail - PC Magazine Editors' Choice 2005

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message