ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joel Riedesel" <jriede...@jnana.com>
Subject Re: java generics compiler and ant?
Date Tue, 19 Jun 2001 12:10:09 GMT
Yeah, that is shooting from the hip!

The problem is that to compile with generics using generic versions
of the java collection classes, you need the collect.jar file which
is a bunch of stubbed versions of the java collection classes.  Obviously,
that file will need to come first in java's bootclasspath.  Yet, if
you do that for Ant itself, then those collections don't work for
Ant since they are only stubs (they are only useful for compiling
against).

The javac program has a -X option which java doesn't.  The example
usage for using the generics compiler uses both -Xbootclasspath and
-bootclasspath.  I really think I'm in the middle of a catch-22 here.

Back to build.bat files!  Hah!

Joel


----- Original Message -----
From: "Rob van Oostrum" <rvanoostrum@ezgov.com>
To: <ant-user@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 5:28 AM
Subject: Re: java generics compiler and ant?


> shooting from the hip here:
>
> Set up your java runtime environment properly (so that the correct javac
and
> libraries get picked up when you run java or javac from a prompt), then
run ant
> itself within the new java stuff, and have the javac task use the classic
> compiler. If that doesn't work, you could always try to re-build ant
itself with
> your new environment, although that shouldn't make any difference, since
the
> generics draft specifically states that all existing binaries are still
valid.
>
> good luck
> Rob
>
> Joel Riedesel wrote:
>
> > Is it possible to use the prototype generics compiler
> > with ant?
> >
> > It's tricky since one must use the javac from the sample
> > generics implementation AND one must cross compile using
> > the collect.jar (collections modified for generics).
> >
> > The collect.jar is stubs of actual collections.  So, if
> > collect.jar is included on ant's classpath, ant doesn't work.
> >
> > My build task looks like this:
> >   <target name="main" depends="init">
> >     <javac srcdir="."
> >            destdir="."
> >
> >
bootclasspath="e:\jnana\java\jks4\generics\collect.jar;e:/jnana/java/jdk1.4b
> > 1/jre/lib/rt.jar"
> >            classpath="${j2eepath}" />
> >   </target>
> >
> > And, ant with verbose looks like this at the appropriate time:
> > ---
> >     [javac] Compilation args: -d E:\Jnana\jks4 -classpath
> > E:\Jnana\jks4;E:\Jnana
> >
\Java\jdk1.4b1\lib\tools.jar;E:\Jnana\Java\jakarta-ant-1.3\lib\parser.jar;E:
> > \Jna
> >
na\Java\jakarta-ant-1.3\lib\jaxp.jar;E:\Jnana\Java\jakarta-ant-1.3\lib\ant.j
> > ar;E
> > :\Jnana\jks4\dev -sourcepath E:\Jnana\jks4 -bootclasspath
> > E:\Jnana\Java\jks4\gen
> > erics\collect.jar;E:\Jnana\Java\jdk1.4b1\jre\lib\rt.jar
> > ---
> >
> > Yet, my test file doesn't compile.  The difficult seems to be that
> > javac is loaded using ant's class loader (which is fine - if we get
> > the JDK1.3 or JDK1.4 javac, then I get a variety of interesting parse
> > errors, I
> > don't get these, so I know it's loading the javac from the generics
> > sample implementation compiler).
> >
> > Now, during the compile, javac looks up a LinkedList (for example) and
> > gets the one in the default class loader (since javac was loaded from
> > the default class loader...) instead of what I specified in
bootclasspath.
> >
> > Any ideas about this?  Is this even possible?
> >
> > Thanks,
> >
> > Joel
>


Mime
View raw message