You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@buildr.apache.org by Antoine Toulme <an...@lunar-ocean.com> on 2010/08/29 02:11:19 UTC

javac and the classpath

I am writing specs for the javac command and I am finding out that it resets
the classpath of the application, since you pass a classpath to it.

At this point, it sounds like the safest option is to shell out instead of
running javac in the current JVM, as it has some nasty side effects.

I discovered the problem when I tried to run several specs that were calling
javac in the same file.

This might not happen with JRuby but I wouldn't take chances on it.

Let me know if you have strong objections ; I'll commit soon but it can be
reverted.

Antoine

Re: javac and the classpath

Posted by Alex Boisvert <al...@gmail.com>.
Oh, sorry, you're talking about javac...  but same thing, I'm not seeing
it.    Maybe you can open an issue and attach your spec?

alex


On Sat, Aug 28, 2010 at 5:29 PM, Alex Boisvert <al...@gmail.com>wrote:

> I'm curious to see the spec;  Java::Commands.java always forks a new java
> process so it shouldn't change the current application classpath.
>
> Maybe I'm missing something?
>
> alex
>
>
>
> On Sat, Aug 28, 2010 at 5:11 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:
>
>> I am writing specs for the javac command and I am finding out that it
>> resets
>> the classpath of the application, since you pass a classpath to it.
>>
>> At this point, it sounds like the safest option is to shell out instead of
>> running javac in the current JVM, as it has some nasty side effects.
>>
>> I discovered the problem when I tried to run several specs that were
>> calling
>> javac in the same file.
>>
>> This might not happen with JRuby but I wouldn't take chances on it.
>>
>> Let me know if you have strong objections ; I'll commit soon but it can be
>> reverted.
>>
>> Antoine
>>
>
>

Re: javac and the classpath

Posted by Alex Boisvert <al...@gmail.com>.
I'm curious to see the spec;  Java::Commands.java always forks a new java
process so it shouldn't change the current application classpath.

Maybe I'm missing something?

alex


On Sat, Aug 28, 2010 at 5:11 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:

> I am writing specs for the javac command and I am finding out that it
> resets
> the classpath of the application, since you pass a classpath to it.
>
> At this point, it sounds like the safest option is to shell out instead of
> running javac in the current JVM, as it has some nasty side effects.
>
> I discovered the problem when I tried to run several specs that were
> calling
> javac in the same file.
>
> This might not happen with JRuby but I wouldn't take chances on it.
>
> Let me know if you have strong objections ; I'll commit soon but it can be
> reverted.
>
> Antoine
>