You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mike Grandmaison <ja...@yahoo.com> on 2006/06/16 23:23:48 UTC

ant javac uses rt.jar even though it isn't in classpath

Hi,

I am trying to compile with ant 1.6.5 using jdk150.  This jdk ships with rt.jar that contains  a version of org.w3c.com that I don't want to use.  I've run ant with verbose mode but it does not show that it is using rt.jar in the javac command but when I remove the offending class from rt.jar the error disappears.  

How can I ensure that rt.jar is at the end of my classpath or make ant not see it?

Thanks,

MG
 			
---------------------------------
Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 

Re: ant javac uses rt.jar even though it isn't in classpath

Posted by Grant Lewis <uk...@yahoo.com>.
If you are using the ant command-line script then it's setting a
classpath before it invokes ant's main class. This classpath likely
includes the rt.jar you are trying to avoid, a bad idea if you ask me. I
would downgrade my JDK before I removed classes from rt.jar or moved
another jar in front of it on the classpath. The reason it works in
Eclipse is because you aren't using the ant script to launch ant, so
your environment is different. You have complete control over the
classpath, no hidden gotchas.

Grant

Mike Grandmaison wrote:
> Hmm...
> 
> Normally I use eclipse to compile and it is able to compile fine as it allows you to have the jdk libraries at the bottom of your classpath.  I don't think this would be something that is specific to eclipse so there must be someway to do this in ant as well?
> 
> Maybe it is the bootclasspath.  I'll try putting my jars there and see if that makes a difference.
> 
> Thanks for the reply !
> 
> MG
> 
> 
> Dominique Devienne <dd...@gmail.com> wrote: I don't think you can "not" use rt.jar, unless you either:
> 
> 1) Use the Endorsed API override mechanism if it applies to this
> particular API, to pick up this particular API from a different jar
> than rt.jar
> 
> 2) Use a different bootclasspath, to use a different "fixed up" rt.jar
> 
> Javac otherwise uses the rt.jar that comes with the JDK. --DD
> 
> On 6/16/06, Mike Grandmaison  wrote:
>> Hi,
>>
>> I am trying to compile with ant 1.6.5 using jdk150.  This jdk ships with rt.jar that contains  a version of org.w3c.com that I don't want to use.  I've run ant with verbose mode but it does not show that it is using rt.jar in the javac command but when I remove the offending class from rt.jar the error disappears.
>>
>> How can I ensure that rt.jar is at the end of my classpath or make ant not see it?
>>
>> Thanks,
>>
>> MG
>>
>> ---------------------------------
>> Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
>  		
> ---------------------------------
> Do you Yahoo!?
>  Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: ant javac uses rt.jar even though it isn't in classpath

Posted by Rainer Noack <ra...@noacks.net>.
Sun's mechanism for your need is the Endorsed API override mechanism.

However, you should remember that you also need to take care of all those
manipulations
To run your program.

Eclipse allows you to do everything with your classpath as it has it's own
compiler.
Nevertheless you have to consider this special classpath when you run the
program
With a standard java runtime.

IMHO, it's never a good practice to change the bootstrap classpath.

Regards

Rainer

> -----Original Message-----
> From: Mike Grandmaison [mailto:java97301@yahoo.com] 
> Sent: Saturday, June 17, 2006 1:19 AM
> To: Ant Users List
> Subject: Re: ant javac uses rt.jar even though it isn't in classpath
> 
> 
> Hmm...
> 
> Normally I use eclipse to compile and it is able to compile 
> fine as it allows you to have the jdk libraries at the bottom 
> of your classpath.  I don't think this would be something 
> that is specific to eclipse so there must be someway to do 
> this in ant as well?
> 
> Maybe it is the bootclasspath.  I'll try putting my jars 
> there and see if that makes a difference.
> 
> Thanks for the reply !
> 
> MG
> 
> 
> Dominique Devienne <dd...@gmail.com> wrote: I don't think 
> you can "not" use rt.jar, unless you either:
> 
> 1) Use the Endorsed API override mechanism if it applies to 
> this particular API, to pick up this particular API from a 
> different jar than rt.jar
> 
> 2) Use a different bootclasspath, to use a different "fixed up" rt.jar
> 
> Javac otherwise uses the rt.jar that comes with the JDK. --DD
> 
> On 6/16/06, Mike Grandmaison  wrote:
> >
> > Hi,
> >
> > I am trying to compile with ant 1.6.5 using jdk150.  This jdk ships 
> > with rt.jar that contains  a version of org.w3c.com that I 
> don't want 
> > to use.  I've run ant with verbose mode but it does not 
> show that it 
> > is using rt.jar in the javac command but when I remove the 
> offending 
> > class from rt.jar the error disappears.
> >
> > How can I ensure that rt.jar is at the end of my classpath 
> or make ant 
> > not see it?
> >
> > Thanks,
> >
> > MG
> >
> > ---------------------------------
> > Sneak preview the  all-new Yahoo.com. It's not radically different. 
> > Just radically better.
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 
>  		
> ---------------------------------
> Do you Yahoo!?
>  Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant javac uses rt.jar even though it isn't in classpath

Posted by Mike Grandmaison <ja...@yahoo.com>.
Hmm...

Normally I use eclipse to compile and it is able to compile fine as it allows you to have the jdk libraries at the bottom of your classpath.  I don't think this would be something that is specific to eclipse so there must be someway to do this in ant as well?

Maybe it is the bootclasspath.  I'll try putting my jars there and see if that makes a difference.

Thanks for the reply !

MG


Dominique Devienne <dd...@gmail.com> wrote: I don't think you can "not" use rt.jar, unless you either:

1) Use the Endorsed API override mechanism if it applies to this
particular API, to pick up this particular API from a different jar
than rt.jar

2) Use a different bootclasspath, to use a different "fixed up" rt.jar

Javac otherwise uses the rt.jar that comes with the JDK. --DD

On 6/16/06, Mike Grandmaison  wrote:
>
> Hi,
>
> I am trying to compile with ant 1.6.5 using jdk150.  This jdk ships with rt.jar that contains  a version of org.w3c.com that I don't want to use.  I've run ant with verbose mode but it does not show that it is using rt.jar in the javac command but when I remove the offending class from rt.jar the error disappears.
>
> How can I ensure that rt.jar is at the end of my classpath or make ant not see it?
>
> Thanks,
>
> MG
>
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.

Re: ant javac uses rt.jar even though it isn't in classpath

Posted by Dominique Devienne <dd...@gmail.com>.
I don't think you can "not" use rt.jar, unless you either:

1) Use the Endorsed API override mechanism if it applies to this
particular API, to pick up this particular API from a different jar
than rt.jar

2) Use a different bootclasspath, to use a different "fixed up" rt.jar

Javac otherwise uses the rt.jar that comes with the JDK. --DD

On 6/16/06, Mike Grandmaison <ja...@yahoo.com> wrote:
>
> Hi,
>
> I am trying to compile with ant 1.6.5 using jdk150.  This jdk ships with rt.jar that contains  a version of org.w3c.com that I don't want to use.  I've run ant with verbose mode but it does not show that it is using rt.jar in the javac command but when I remove the offending class from rt.jar the error disappears.
>
> How can I ensure that rt.jar is at the end of my classpath or make ant not see it?
>
> Thanks,
>
> MG
>
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org