You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stephane Bailliez <sb...@apache.org> on 2004/03/02 15:43:35 UTC

Ant scripts

Getting up to speed.

Can someone enlighten me on what is the motivation to use the classpath to
load ant libraries if it the env variable is defined ?
I feel like expecting to find ant libraries if the classpath is defined is a
bit rough on the edge as it is a common env variable, but I'm probably
missing something straightforward.

I have been called to the rescue by some coworkers that could not understand
why Ant was working on some computers and not on others
(InstantiationException). Of course this is because the classpath was
sometimes defined, sometimes not.

 Cheers,

Stephane




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


Re: Ant scripts

Posted by Stephane Bailliez <sb...@apache.org>.
"Antoine L�vy-Lambert" <an...@antbuild.com> wrote in message
news:4044F6B4.7090707@antbuild.com...
> A colleague of mine told me that ant 1.6 has problems if ANT_HOME or
> JAVA_HOME are UNC paths
> ( \\somemachine\mountpoint\.....)
> This problem shows up starting ant with ant.bat.
> I need to confirm this problem.
>
> Maybe this is the one issue you got hit with, Stephane,

Nope, that's the first thing I checked, it was a local directory (with
space), like "C:\Program Files\ant"
What's weird is that I fixed the fact that the launcher could not find ant
Main class by doing a 'set CLASSPATH='

Stephane




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


Re: Ant scripts

Posted by Matt Benson <gu...@yahoo.com>.
--- Matt Benson <gu...@yahoo.com> wrote:
> --- Antoine_L�vy-Lambert <an...@antbuild.com>
> wrote:
> > A colleague of mine told me that ant 1.6 has
> > problems if ANT_HOME or 
> > JAVA_HOME are UNC paths
> > ( \\somemachine\mountpoint\.....)
> > This problem shows up starting ant with ant.bat.
> > I need to confirm this problem.
> 
> 
> Never thought of that.  I get "Exception in thread
> "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/launch/Launcher" :(
> 

Followup:  Looks like we are dealing with more
escaping issues.

-Matt

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com

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


Re: Ant scripts

Posted by Matt Benson <gu...@yahoo.com>.
--- Antoine_L�vy-Lambert <an...@antbuild.com> wrote:
> A colleague of mine told me that ant 1.6 has
> problems if ANT_HOME or 
> JAVA_HOME are UNC paths
> ( \\somemachine\mountpoint\.....)
> This problem shows up starting ant with ant.bat.
> I need to confirm this problem.


Never thought of that.  I get "Exception in thread
"main" java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/Launcher" :(

-Matt

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com

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


Re: Ant scripts

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
Stephane Bailliez wrote:

>"Stefan Bodewig" <bo...@apache.org> wrote in message
>news:m3k7232pkl.fsf@bodewig.bost.de...
>
>  
>
>>I think there is a know problem when CLASSPATH contains unexpanded
>>environment variables.
>>    
>>
>
>No the classpath was fully expanded. (but made of a mix of slashes,
>backslashes and whitespaces... )
>It's just that the Launcher wasn't able to find the Main class, which means
>that for some reasons something went wild in the launcher while building the
>jar list for the urlclassloader
>
>Very weird. Unfortunately I don't have access to that machine easily to
>reproduce the problem.
>
>  
>
>>Back to your original question, Ant has always used CLASSPATH as well
>>as ANT_HOME/lib and still does so, there shouldn't be any visible
>>change.
>>    
>>
>
>Stephane
>
>
>
>  
>
A colleague of mine told me that ant 1.6 has problems if ANT_HOME or 
JAVA_HOME are UNC paths
( \\somemachine\mountpoint\.....)
This problem shows up starting ant with ant.bat.
I need to confirm this problem.

Maybe this is the one issue you got hit with, Stephane,

cheers,

Antoine



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


Re: Ant scripts

Posted by Stephane Bailliez <sb...@apache.org>.
"Stefan Bodewig" <bo...@apache.org> wrote in message
news:m3k7232pkl.fsf@bodewig.bost.de...

> I think there is a know problem when CLASSPATH contains unexpanded
> environment variables.

No the classpath was fully expanded. (but made of a mix of slashes,
backslashes and whitespaces... )
It's just that the Launcher wasn't able to find the Main class, which means
that for some reasons something went wild in the launcher while building the
jar list for the urlclassloader

Very weird. Unfortunately I don't have access to that machine easily to
reproduce the problem.

> Back to your original question, Ant has always used CLASSPATH as well
> as ANT_HOME/lib and still does so, there shouldn't be any visible
> change.

Stephane




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


Re: Ant scripts

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 2 Mar 2004, Stephane Bailliez <sb...@apache.org> wrote:
> "Stefan Bodewig" <bo...@apache.org> wrote in message
> news:m3n06z4829.fsf@bodewig.bost.de...
>> On Tue, 2 Mar 2004, Stephane Bailliez <sb...@apache.org> wrote:
>>
>> > Can someone enlighten me on what is the motivation to use the
>> > classpath to load ant libraries if it the env variable is defined
>> > ?
>>
>> Unix or Windows?  HEAD or 1.6 branch?
> 
> Windows, 1.6.1

I think there is a know problem when CLASSPATH contains unexpanded
environment variables.

Back to your original question, Ant has always used CLASSPATH as well
as ANT_HOME/lib and still does so, there shouldn't be any visible
change.

Stefan

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


Re: Ant scripts

Posted by Stephane Bailliez <sb...@apache.org>.
"Stefan Bodewig" <bo...@apache.org> wrote in message
news:m3n06z4829.fsf@bodewig.bost.de...
> On Tue, 2 Mar 2004, Stephane Bailliez <sb...@apache.org> wrote:
>
> > Can someone enlighten me on what is the motivation to use the
> > classpath to load ant libraries if it the env variable is defined ?
>
> Unix or Windows?  HEAD or 1.6 branch?

Windows, 1.6.1

I did not have time to fully look into the problem but it seems to be
related to that (as I fixed it by doing a set CLASSPATH=) , but I cannot
reproduce on my machine... should it be using shell script or bat.

> BTW, welcome back Stephane 8-)

Thanks.
Unfortunately not yet stable and fully operational. Still fighting to find
an apartment so that I can have my own space and time when I'm not behind a
firewall that blocks everything but http and https (governement), or if
simply it is forbidden to be connected to the local network and the internet
(defense)





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


Re: Ant scripts

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 2 Mar 2004, Stephane Bailliez <sb...@apache.org> wrote:

> Can someone enlighten me on what is the motivation to use the
> classpath to load ant libraries if it the env variable is defined ?

Unix or Windows?  HEAD or 1.6 branch?

BTW, welcome back Stephane 8-)

Stefan

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