ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob van Oostrum <rvanoost...@ezgov.com>
Subject Re: java generics compiler and ant?
Date Tue, 19 Jun 2001 11:28:48 GMT
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