You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chris Bailey <ch...@codeintensity.com> on 2002/06/13 08:27:35 UTC

Need help running Ant under cygwin on Win2k

I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.  I've
installed Ant and JDK 1.4 in the Cygwin paths (/usr/local) as I saw someone
suggest in the mailing list archives, and set my ANT_HOME and JAVA_HOME to
those.  However, whether I do it that way, or just have Ant and JDK
installed under normal Windows locations (and thus set ANT_HOME to something
like /cygdrive/c/ant), I get the following error message when running Ant:

  Exception in thread "main" java.lang.NoClassDefFoundError: and

If I run Ant at a normal DOS prompt, it runs fine.  Anyone have any ideas on
how I can fix this?

____
Chris Bailey       mailto:chris@codeintensity.com
Code Intensity       http://www.codeintensity.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need help running Ant under cygwin on Win2k

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Chris Bailey wrote:
> Ok, the cygwin.home.user works.  But, the slashes seem to be the opposite
> behavior.  For example, I set a property for a Perl script we run, as this:
> 
>   <property name="bin"           location="bin"/>
>   <property name="wmdl.compiler" location="${bin}/wmdlcc.pl"/>
> 
> Then I exec ${wmdl.compiler}, but what I see Ant 1.5Beta2 spit out is:
> 
> BUILD FAILED
> C:\cygwin\home\crb\wego\build.xml:265: Execute failed: java.io.IOException:
> Crea
> teProcess: C:\cygwin\home\crb\wego\bin\wmdlcc.pl error=193
> 
> So, Cygwin/Ant is using backslashes.  It's also sticking the C: in there.
> It's as if it's behaving as a real Windows app.  Do I not have something
> configured correctly?
> 

The JDK *is* a real windows App and therefore Ant under that JDK, 
regardless of whether you started it with cmd.exe or cygwin, thinks it 
is running on Windows - which it is :-)

IOW, JDK is not linked against Cygwin.

Conor





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need help running Ant under cygwin on Win2k

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Chris Bailey" <ch...@codeintensity.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 13:20
Subject: RE: Need help running Ant under cygwin on Win2k


> I use ActivePerl as well, but I can't just run "somescript.pl" from a DOS
> prompt on Windows.  So, I would need to change my Ant files to do "perl
> somescript.pl", which is not a big deal, but is ugly.

a) yes you can, already explained
b) add it to the PATHEXT env variable, and you can go "somescript" on the
command line and have the perl file executed.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
I use ActivePerl as well, but I can't just run "somescript.pl" from a DOS
prompt on Windows.  So, I would need to change my Ant files to do "perl
somescript.pl", which is not a big deal, but is ugly.

-----Original Message-----
From: Steve Loughran [mailto:steve_l@iseran.com]
Sent: Tuesday, June 18, 2002 9:42 AM
To: Ant Users List
Subject: Re: Need help running Ant under cygwin on Win2k



----- Original Message -----
From: "Chris Bailey" <ch...@codeintensity.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 6:20 AM
Subject: RE: Need help running Ant under cygwin on Win2k


> So, this makes the whole "location" property thing more painful then.  If
I
> use "value" instead, then the value of the property is just what I type,
so,
> below the "bin" property will just be "bin", as opposed to doing a
relative
> path resolution to wherever the bin dir is located.
>
> At this point, it seems fairly painful for me to run Ant under Cygwin.
I'm
> not blaming Ant, as it really is a combination of the JDK, ant, some
crappy
> scripts we have that need full paths and so on.  Windows of course makes
it
> even worse, because I can't simply run a Perl script as I do on a UNIX
box.
> This was one of the reasons I figured we'd use Cygwin in the first place.
> Oh well.

you dont need cygwin to run perl; ActiveScript perl runs happily on raw
windows. I know, I use it


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need help running Ant under cygwin on Win2k

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Chris Bailey" <ch...@codeintensity.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 6:20 AM
Subject: RE: Need help running Ant under cygwin on Win2k


> So, this makes the whole "location" property thing more painful then.  If
I
> use "value" instead, then the value of the property is just what I type,
so,
> below the "bin" property will just be "bin", as opposed to doing a
relative
> path resolution to wherever the bin dir is located.
>
> At this point, it seems fairly painful for me to run Ant under Cygwin.
I'm
> not blaming Ant, as it really is a combination of the JDK, ant, some
crappy
> scripts we have that need full paths and so on.  Windows of course makes
it
> even worse, because I can't simply run a Perl script as I do on a UNIX
box.
> This was one of the reasons I figured we'd use Cygwin in the first place.
> Oh well.

you dont need cygwin to run perl; ActiveScript perl runs happily on raw
windows. I know, I use it


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Diane Holt <ho...@yahoo.com>.
--- Chris Bailey <ch...@codeintensity.com> wrote:
> Putting it in the path is not really acceptable.

That's why I also suggested using <env> instead, so you could include the
dir the script lives in when you run your <exec>.

To make the whole thing platform-independent, you'd want to set up a
<path> based on where the script lives plus your PATH env var (so you'd
need to do a <property environment=.../>), then <pathconvert> that <path>
into a property, and reference that property in the 'value' for the <env>.
For example:

  <property name="filename" value="src/lib/foo.a"/>
  <property environment="env"/>
  <path id="path" path="${env.PATH}:${env.TEMP}/bin"/>
  <target name="main">
    <pathconvert pathsep="${path.separator}" refid="path"
property="path"/>
    <exec executable="sh">
      <arg line='-c "printit.pl ${filename}"'/>
      <env key="PATH" value="${path}"/>
    </exec>
  </target>

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
Putting it in the path is not really acceptable.  It's a script that is
specific to our build environment (it's a compiler we wrote), so IMHO, it
has no business being on the general path environment variable.  Plus, as
soon as I require it to be on the path, that's just one more thing folks
would have to set up and have right, as opposed to simply being able to
check the whole thing out from CVS and just do "ant" and get it to build.

Another consideration was to define something like a $PROJECT_HOME
environment variable, and then use the "value" attribute with property
definition (instead of "location"), and prefix everything with
$PROEJCT_HOME.  The only problem with this is that we might have multiple
sandboxes for the project (say to work on various branches or for testing or
whatever), and then I'd have to constantly update my $PROJECT_HOME to make
it work right.

Heh, all this so some poor guy can build on a Windows box ;)

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Tuesday, June 18, 2002 8:00 AM
To: Ant Users List
Subject: RE: Need help running Ant under cygwin on Win2k


--- Chris Bailey <ch...@codeintensity.com> wrote:
> At this point, it seems fairly painful for me to run Ant under Cygwin.

I don't find it painful at all. I've been doing it for over a year -- it's
what I create all my brilliant solutions to ant-user on :)

After I sent that mail last night, it occurred to me that you weren't
setting a property you were going to pass as an arg to your script, but
rather you were pointing to your perl script itself with the property.
That, you don't need to do at all -- just make sure where it lives is
included in your PATH (or try passing it in an <env> -- I don't have time
this morning to experiment).

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Diane Holt <ho...@yahoo.com>.
--- Chris Bailey <ch...@codeintensity.com> wrote:
> At this point, it seems fairly painful for me to run Ant under Cygwin. 

I don't find it painful at all. I've been doing it for over a year -- it's
what I create all my brilliant solutions to ant-user on :)

After I sent that mail last night, it occurred to me that you weren't
setting a property you were going to pass as an arg to your script, but
rather you were pointing to your perl script itself with the property.
That, you don't need to do at all -- just make sure where it lives is
included in your PATH (or try passing it in an <env> -- I don't have time
this morning to experiment).

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
So, this makes the whole "location" property thing more painful then.  If I
use "value" instead, then the value of the property is just what I type, so,
below the "bin" property will just be "bin", as opposed to doing a relative
path resolution to wherever the bin dir is located.

At this point, it seems fairly painful for me to run Ant under Cygwin.  I'm
not blaming Ant, as it really is a combination of the JDK, ant, some crappy
scripts we have that need full paths and so on.  Windows of course makes it
even worse, because I can't simply run a Perl script as I do on a UNIX box.
This was one of the reasons I figured we'd use Cygwin in the first place.
Oh well.

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Tuesday, June 18, 2002 12:00 AM
To: Ant Users List
Subject: RE: Need help running Ant under cygwin on Win2k


--- Chris Bailey <ch...@codeintensity.com> wrote:
> Ok, the cygwin.home.user works.  But, the slashes seem to be the
> opposite behavior.  For example, I set a property for a Perl script
> we run, as this:
>
>   <property name="bin"           location="bin"/>
>   <property name="wmdl.compiler" location="${bin}/wmdlcc.pl"/>
>
> Then I exec ${wmdl.compiler}, but what I see Ant 1.5Beta2 spit out is:

You'd need to use 'value' instead of 'location' -- and you'd need to run
it all through 'sh', not exec the perl script directly. For example:

  <property name="filename" value="/usr/local/lib/foo.a"/>
  <target name="runscript">
    <exec executable="sh">
      <arg line='-c "printit.pl ${filename}"'/>
    </exec>
  </target>

$ ant runscript
runscript:
     [exec] filename = /usr/local/lib/foo.a

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Diane Holt <ho...@yahoo.com>.
--- Chris Bailey <ch...@codeintensity.com> wrote:
> Ok, the cygwin.home.user works.  But, the slashes seem to be the
> opposite behavior.  For example, I set a property for a Perl script
> we run, as this:
> 
>   <property name="bin"           location="bin"/>
>   <property name="wmdl.compiler" location="${bin}/wmdlcc.pl"/>
> 
> Then I exec ${wmdl.compiler}, but what I see Ant 1.5Beta2 spit out is:

You'd need to use 'value' instead of 'location' -- and you'd need to run
it all through 'sh', not exec the perl script directly. For example:

  <property name="filename" value="/usr/local/lib/foo.a"/>
  <target name="runscript">
    <exec executable="sh">
      <arg line='-c "printit.pl ${filename}"'/>
    </exec>
  </target>

$ ant runscript
runscript:
     [exec] filename = /usr/local/lib/foo.a

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
Ok, the cygwin.home.user works.  But, the slashes seem to be the opposite
behavior.  For example, I set a property for a Perl script we run, as this:

  <property name="bin"           location="bin"/>
  <property name="wmdl.compiler" location="${bin}/wmdlcc.pl"/>

Then I exec ${wmdl.compiler}, but what I see Ant 1.5Beta2 spit out is:

BUILD FAILED
C:\cygwin\home\crb\wego\build.xml:265: Execute failed: java.io.IOException:
Crea
teProcess: C:\cygwin\home\crb\wego\bin\wmdlcc.pl error=193

So, Cygwin/Ant is using backslashes.  It's also sticking the C: in there.
It's as if it's behaving as a real Windows app.  Do I not have something
configured correctly?

-----Original Message-----
From: Bill Burton [mailto:billb@progress.com]
Sent: Monday, June 17, 2002 7:13 PM
To: Ant Users List
Subject: Re: Need help running Ant under cygwin on Win2k


Hello Chris,

Chris Bailey wrote:
> It also appears that maybe CYGWIN sets the $USERPROFILE environment var,
and
> it happens to be set to C:\Documents and Settings\login for me.

$USERPROFILE is set by WinNT/2000/XP in cmd.exe based on the locaton of
your user profile.  Cygwin is inheriting the existing value when starting
bash.

 > This appears to be hosing some of my scripts, because Ant's user.home
property is
> being set to this.

The user.home property is set by the JVM, not by Ant.

> I haven't found where to change $USERPROFILE yet,
> anyone?

You shouldn't change it because it could cause the JVM to fail upon
startup.  Remember, a Windows JVM does not understand Cygwin paths.  Since
Ant is running under such a JVM, it can't understand Cygwin paths either.
  However, forward slashes "/" are okay with the exception that if you
<exec> an external program, it may not support them in any arguments.

The ant script in 1.5B2 defines the system property cygwin.user.home which
is $HOME converted to a Windows format path.  If you set $HOME to the
desired Cygwin path before starting Ant, you can reference that path
within you build.xml as ${cygwin.user.home}.

Hope this helps,
-Bill

> -----Original Message-----
> From: Ray Tayek [mailto:rtayek@attbi.com]
> Sent: Thursday, June 13, 2002 3:13 PM
> To: Ant Users List
> Subject: Re: Need help running Ant under cygwin on Win2k
>
>
> At 11:27 PM 6/12/02 -0700, you wrote:
>
>>I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.
>
>
> just a tip. be careful of things like classpath=c:\foo;c:\bar - the ';'
> will terminate the statement!
>
> thanks
>
>
> ---
> ray tayek http://home.attbi.com/~rtayek/ actively seeking telecommuting
work
> vice chair orange county java users group http://www.ocjug.org/
> mailto:chair@ocjug.org
> hate spam? http://samspade.org/ssw/



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need help running Ant under cygwin on Win2k

Posted by Bill Burton <bi...@progress.com>.
Hello Chris,

Chris Bailey wrote:
> It also appears that maybe CYGWIN sets the $USERPROFILE environment var, and
> it happens to be set to C:\Documents and Settings\login for me.  

$USERPROFILE is set by WinNT/2000/XP in cmd.exe based on the locaton of 
your user profile.  Cygwin is inheriting the existing value when starting 
bash.

 > This appears to be hosing some of my scripts, because Ant's user.home 
property is
> being set to this.  

The user.home property is set by the JVM, not by Ant.

> I haven't found where to change $USERPROFILE yet,
> anyone?

You shouldn't change it because it could cause the JVM to fail upon 
startup.  Remember, a Windows JVM does not understand Cygwin paths.  Since 
Ant is running under such a JVM, it can't understand Cygwin paths either. 
  However, forward slashes "/" are okay with the exception that if you 
<exec> an external program, it may not support them in any arguments.

The ant script in 1.5B2 defines the system property cygwin.user.home which 
is $HOME converted to a Windows format path.  If you set $HOME to the 
desired Cygwin path before starting Ant, you can reference that path 
within you build.xml as ${cygwin.user.home}.

Hope this helps,
-Bill

> -----Original Message-----
> From: Ray Tayek [mailto:rtayek@attbi.com]
> Sent: Thursday, June 13, 2002 3:13 PM
> To: Ant Users List
> Subject: Re: Need help running Ant under cygwin on Win2k
> 
> 
> At 11:27 PM 6/12/02 -0700, you wrote:
> 
>>I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.
> 
> 
> just a tip. be careful of things like classpath=c:\foo;c:\bar - the ';'
> will terminate the statement!
> 
> thanks
> 
> 
> ---
> ray tayek http://home.attbi.com/~rtayek/ actively seeking telecommuting work
> vice chair orange county java users group http://www.ocjug.org/
> mailto:chair@ocjug.org
> hate spam? http://samspade.org/ssw/



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
It also appears that maybe CYGWIN sets the $USERPROFILE environment var, and
it happens to be set to C:\Documents and Settings\login for me.  This
appears to be hosing some of my scripts, because Ant's user.home property is
being set to this.  I haven't found where to change $USERPROFILE yet,
anyone?

-----Original Message-----
From: Ray Tayek [mailto:rtayek@attbi.com]
Sent: Thursday, June 13, 2002 3:13 PM
To: Ant Users List
Subject: Re: Need help running Ant under cygwin on Win2k


At 11:27 PM 6/12/02 -0700, you wrote:
>I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.

just a tip. be careful of things like classpath=c:\foo;c:\bar - the ';'
will terminate the statement!

thanks


---
ray tayek http://home.attbi.com/~rtayek/ actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need help running Ant under cygwin on Win2k

Posted by Ray Tayek <rt...@attbi.com>.
At 11:27 PM 6/12/02 -0700, you wrote:
>I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.

just a tip. be careful of things like classpath=c:\foo;c:\bar - the ';' 
will terminate the statement!

thanks


---
ray tayek http://home.attbi.com/~rtayek/ actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need help running Ant under cygwin on Win2k

Posted by Chris Bailey <ch...@codeintensity.com>.
Never mind.  Of course immediately after I post I finally figured it out.
My $HOME was set to C:\Documents and Settings\crb\My Documents.  Obviously
it didn't like that path with the spaces and such.

-----Original Message-----
From: Chris Bailey [mailto:chris@codeintensity.com]
Sent: Wednesday, June 12, 2002 11:28 PM
To: AntMailingList
Subject: Need help running Ant under cygwin on Win2k


I'm trying to run Ant 1.5beta2 on a Windows 2000 machine under Cygwin.  I've
installed Ant and JDK 1.4 in the Cygwin paths (/usr/local) as I saw someone
suggest in the mailing list archives, and set my ANT_HOME and JAVA_HOME to
those.  However, whether I do it that way, or just have Ant and JDK
installed under normal Windows locations (and thus set ANT_HOME to something
like /cygdrive/c/ant), I get the following error message when running Ant:

  Exception in thread "main" java.lang.NoClassDefFoundError: and

If I run Ant at a normal DOS prompt, it runs fine.  Anyone have any ideas on
how I can fix this?

____
Chris Bailey       mailto:chris@codeintensity.com
Code Intensity       http://www.codeintensity.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>