ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject Available Task and Classpath
Date Tue, 18 Dec 2001 09:07:31 GMT

sorry, but I have to raise this issue again:

When you are building any target with ant which tests for optional
you sooner or later face the problem where to search for the availability of
the components.
Usually the Available task is the thing to use. You can give this task a
classpath to search for and you can set the build.sysclasspath property to
either ignore the user classpath or not etc.
But, the Available task always finds the standard JDK classes (packages
and javax.).
Now, looking at this behaviour, it seems alright - but unfortunately it can
cause problems:
For example, imagine an application which has optional LDAP components
the JNDI packages. You have your Available test in your build file and build
the application with JDK 1.3. As the Available task finds always the JNDI
from the JDK your optional LDAP component is included in the final build
application, but - of course - not the JNDI package.
And now the problem: you run your build application with JDK 1.2 which is
usually totally legal. But JDK 1.2 has not the JNDI package included...

Now, you can say, the build application must always run on a similar system
where it was build on, so it's not legal to run it on JDK 1.2. Hm, this is
not a good idea as for example a lot of the downloadable distributions (and
the nightly builds) from apache are build using JDK 1.3 - so everyone
a binary distribution needs JDK 1.3 (if such an optional component exists).
We have exactly this problem with Apache Cocoon!

So, I hope you can see from description, where my problems with the
task are. I entered this months ago as a bug
(, but it was

I think, the build.sysclasspath property is not correctly implemented for
Available task - or it has the wrong name as not the system classpath is
but the user classpath.

So, what do you think? Is this a self-made problem, or exists there another


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

View raw message