You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2000/09/20 00:27:06 UTC

Keeping a non-runtime-added classpath for compiles

I don't know if I'm unique in this need -- and if I am, I won't expect
this to be added to <javac> generally (especially not on the heels of Ken
Wood's mail :) -- but I have a need to not have the runtime stuff added to
the classpath I use to do compiles.  In Javac.java, there's a boolean,
addRuntime, which is set true for jikes (which I use) (it's hard-coded
true in the call to getCompileClasspath, in doJikesCompile). As a
workaround for now, I've changed it to be hard-coded false -- but I'd
prefer to have an attribute for <javac> (maybe addruntime="no" -- default
would be "yes").

If you want to know why I need this, read on. I need to be able to execute
ant with a JVM >118 in order to have subproject compiles not end up
causing both the DOS window pop-up thing and large compiles to hit the
"string too long" error. I also like being able to have my runtime java
stuff be jdk13 -- it's got the fastest jar for one thing, and I'm
assuming, since it's latest&greatest, it's just the better one to use.
But, here's the thing, I cannot have any of the runtime stuff in my
compile classpath, because compiles will break. The way I have it now, I
don't have a $CLASSPATH in my environment (I let ant build that for me),
and I'm passing in a property (compile.classpath) and setting the
classpath attribute in <javac> to that -- which all works great, unless
the compile classpath gets the runtime stuff added to it, then it all
falls down. So I modified Javac.java to turn that off, and all is now well
-- I get the runtime I want, and the compile env I need. But, it does mean
having to live with a non-off-the-shelf Ant -- which I can do, if having
an addruntime attribute is not something anyone else would ever feel a
need for. (No one else has build-order, either, so I wouldn't be surprised
if it turned out no else would ever need this. :)

Thanks,
Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Re: Keeping a non-runtime-added classpath for compiles

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "DH" == Diane Holt <ho...@yahoo.com> writes:

 DH> In Javac.java, there's a boolean, addRuntime, which is set true
 DH> for jikes (which I use)

This is there, because you need the runtime classes in the classpath
to compile anything. javac adds them itself while jikes doesn't -
that's what the boolean is for.

In your case you don't really want to exclude the runtime classes but
specify a different library of runtime classes than the ones Ant would
add.

I think what you want to achieve could be done by specifying the
alternate runtime library in the bootclasspath of the javac task. Does
this work?

Stefan