ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Krammer <kram...@spotfire.com>
Subject Re: registry JRE vs. JDK with java task
Date Wed, 22 Nov 2000 18:28:51 GMT
On 22 Nov 2000, Stefan Bodewig wrote:

> Add another option to not add Path.systemClasspath as well and I'll
> commit them (unless anybody else objects).

<lurking mode off>

I've had problems with the way that the Javac task handles the classpath
for Jikes. I'm running Ant 1.2 with Java 2 SDK 1.2.2, but compiling for a
JDK 1.1 target JVM (the product is an applet). I think it should be
possible to specify bootclasspath and extdirs attributes to make it work.
However, in addition to these parameters, Ant adds the runtime system
classpath as well as the runtime value of the "java.ext.dirs" system
property.

With this build target I get the classpath argument for jikes listed
below:

<property name="build.compiler" value="jikes"/>
<javac srcdir="D:\Project\src"
       bootclasspath="D:\Project\lib\classes.zip">
  <classpath>
    <pathelement location="D:\Project\lib\junit.jar"/>
  </classpath>
</javac>

D:\Project\lib\classes.zip;
D:\Programs\jre1.2.2\lib\ext\iiimp.jar;
D:\Project\lib\junit.jar;
D:\Project\src;
D:\Programs\Ant-1.2\lib\ant.jar;
D:\Programs\Ant-1.2\lib\jaxp.jar;
D:\Programs\Ant-1.2\lib\parser.jar;
D:\Programs\jdk1.2.2\lib\tools.jar;
D:\Programs\jre1.2.2\lib\rt.jar

What I do want is a classpath containing only these elements:

D:\Projects\t2\lib\classes.zip;
D:\Projects\t2\lib\junit.jar;
D:\Projects\t2\src\product;

I think that a reasonable behaviour would be to skip the runtime system
classpath and the paths defined in the "java.ext.dirs" system property if
you specify a bootclasspath attribute. Specifying a bootclasspath but no
extdirs attribute would result in an empty extdirs path. If you specify
just an extdirs attribute (but no bootclasspath), it gets added to the
list of default extdirs read from the "java.ext.dirs" property. If you
don't specify any of the bootclasspath or extdirs attributes, the current
behaviour seems appropriate.

This is the way my own hacked Javac task works right now.

What do you think?

- Michael

----------------------------------------------------------------------
Michael Krammer           ***  Stop the continental drift NOW!  ***
email: krammer@spotfire.com     web: http://www.spotfire.com
Spotfire AB, Första Långgatan 26, SE-413 28 Göteborg, Sweden





Mime
View raw message