ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murray, Mike" <>
Subject RE: Classpath Wildcards
Date Thu, 26 Feb 2009 15:49:46 GMT
I'm setting up a classpath for a forked <java>.  I understand how Ant
wildcards work.  I was previously using ant wildcards to define the
classpath, but the cmd line exceeds the windows limit when ${srclib} is

      <fileset dir="${srclib}">
         <include name="*/*.jar"/>

I want the classpath to include the literal string "wnc/*", which is a
valid java classpath element.  Since I used "pathelement path",
shouldn't it take this as a literal?  I think it does, except that it
appears to validating it, and throwing it out as non-existent.  I would
expect this validation with "pathelement location", but not "pathelement

Thanks, Mike

-----Original Message-----
From: [] 
Sent: Thursday, February 26, 2009 12:02 AM
Subject: AW: Classpath Wildcards

>I'm trying to use Java's Classpath wildcards to limit the cmd length on
>forked java calls.
>   <pathelement path="${srclib}/wnc/*"/> 

That's not a Java wildcard, it's an Ant wildcard.
Because <pathelement> is an Ant construct and Java wildcard can only be
used from the command line.

>But, Ant is throwing it out.
>  dropping L:\Windchill\srclib\wnc\* from path as it doesn't exist
>       [java] Executing 'D:\programs\jdk1.6.0_10\jre\bin\java.exe' with
>Is there any way to do this?

Ant doesnt pass all found classfiles to the program - it sets up a
classloader. Therefore
it can handle large numbers of files itself.

So use an Ant wildcard:
  <pathelement path="${srclib}/wnc/**"/>   
(add one star ;)

   '*'   every file in the directory
   '**'  every file somewhere under the directory


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

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

View raw message