You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jaybytez <ja...@gmail.com> on 2009/06/09 20:00:10 UTC
Ant works in Dos Window but not Cygwin Window
I just pulled down the latest 1.7.1 to try and resolve an issue I have been
having lately with my Ant instance 1.7.0.
I am not sure if I should really be posting this on Cygwin's forum, but I
can open an instance of DOS prompt and type ant -version and correctly get
the version echoed to the screen. If I open up a cygwin window and type ant
-version, I get the following error:
$ ant -version
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/tools/ant/
launch/Launcher
Caused by: java.lang.ClassNotFoundException:
org.apache.tools.ant.launch.Launche
r
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
My ANT_HOME is set correctly, and I include ANT_HOME/bin in the PATH
environment variable as well.
Is there anything else I should be looking at to resolve this?
Thanks, jay
--
View this message in context: http://www.nabble.com/Ant-works-in-Dos-Window-but-not-Cygwin-Window-tp23948225p23948225.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant works in Dos Window but not Cygwin Window
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Well, you might just want to swap the slashes around and be sure to escape
any spaces that may be in the contents of ANT_HOME like:
ANT_HOME=c:/java/ant\ 1.7.1
On Tue, 9 Jun 2009, Chad McHenry wrote:
> $ANT_HOME and $JAVA_HOME should be windows format, e.g.
>
> ANT_HOME=C:\java\ant
> JAVA_HOME=C:\java\jdk
>
> I set these via the system so they are available in DOS or bash.
>
> When Java is running on a windows machine (regardless of cygwin's
> presence) it wants windows style paths. We also have to quote
> classpaths on the command line, since windows path separator is ';'
> (unix is ':') and cygwin sees ';' as the end of a command. Luckily
> java doesn't differentiate between '/' or '\' so we don't need to
> worry about escaping them:
>
> java -cp "c:/java/foo/foo.jar;c:/java/bar/bar.jar" MainClass
>
> On Tue, Jun 9, 2009 at 3:01 PM, Scot P. Floess<sf...@nc.rr.com> wrote:
>>
>> How is ANT_HOME defined?
>>
>> I think you'll have to be careful if you are trying the c:\ as your ANT_HOME
>> - perhaps /cygdrive/c and the rest of the path?
>>
>> On Tue, 9 Jun 2009, jaybytez wrote:
>>
>>>
>>> I just pulled down the latest 1.7.1 to try and resolve an issue I have
>>> been
>>> having lately with my Ant instance 1.7.0.
>>>
>>> I am not sure if I should really be posting this on Cygwin's forum, but I
>>> can open an instance of DOS prompt and type ant -version and correctly get
>>> the version echoed to the screen. �If I open up a cygwin window and type
>>> ant
>>> -version, I get the following error:
>>>
>>> $ ant -version
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> org/apache/tools/ant/
>>> launch/Launcher
>>> Caused by: java.lang.ClassNotFoundException:
>>> org.apache.tools.ant.launch.Launche
>>> r
>>> � � � at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>> � � � at java.security.AccessController.doPrivileged(Native Method)
>>> � � � at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>> � � � at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>> � � � at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>>> � � � at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>> � � � at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>>>
>>> My ANT_HOME is set correctly, and I include ANT_HOME/bin in the PATH
>>> environment variable as well.
>>>
>>> Is there anything else I should be looking at to resolve this?
>>>
>>> Thanks, jay
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Ant-works-in-Dos-Window-but-not-Cygwin-Window-tp23948225p23948225.html
>>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC �27549
>>
>> 252-478-8087 (Home)
>> 919-890-8117 (Work)
>>
>> Chief Architect JPlate � http://sourceforge.net/projects/jplate
>> Chief Architect JavaPIM �http://sourceforge.net/projects/javapim
>>
>> Architect Keros � � � � �http://sourceforge.net/projects/keros
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
Re: Ant works in Dos Window but not Cygwin Window
Posted by Chad McHenry <mc...@gmail.com>.
$ANT_HOME and $JAVA_HOME should be windows format, e.g.
ANT_HOME=C:\java\ant
JAVA_HOME=C:\java\jdk
I set these via the system so they are available in DOS or bash.
When Java is running on a windows machine (regardless of cygwin's
presence) it wants windows style paths. We also have to quote
classpaths on the command line, since windows path separator is ';'
(unix is ':') and cygwin sees ';' as the end of a command. Luckily
java doesn't differentiate between '/' or '\' so we don't need to
worry about escaping them:
java -cp "c:/java/foo/foo.jar;c:/java/bar/bar.jar" MainClass
On Tue, Jun 9, 2009 at 3:01 PM, Scot P. Floess<sf...@nc.rr.com> wrote:
>
> How is ANT_HOME defined?
>
> I think you'll have to be careful if you are trying the c:\ as your ANT_HOME
> - perhaps /cygdrive/c and the rest of the path?
>
> On Tue, 9 Jun 2009, jaybytez wrote:
>
>>
>> I just pulled down the latest 1.7.1 to try and resolve an issue I have
>> been
>> having lately with my Ant instance 1.7.0.
>>
>> I am not sure if I should really be posting this on Cygwin's forum, but I
>> can open an instance of DOS prompt and type ant -version and correctly get
>> the version echoed to the screen. If I open up a cygwin window and type
>> ant
>> -version, I get the following error:
>>
>> $ ant -version
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/tools/ant/
>> launch/Launcher
>> Caused by: java.lang.ClassNotFoundException:
>> org.apache.tools.ant.launch.Launche
>> r
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>>
>> My ANT_HOME is set correctly, and I include ANT_HOME/bin in the PATH
>> environment variable as well.
>>
>> Is there anything else I should be looking at to resolve this?
>>
>> Thanks, jay
>> --
>> View this message in context:
>> http://www.nabble.com/Ant-works-in-Dos-Window-but-not-Cygwin-Window-tp23948225p23948225.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-890-8117 (Work)
>
> Chief Architect JPlate http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
> Architect Keros http://sourceforge.net/projects/keros
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Ant works in Dos Window but not Cygwin Window
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
How is ANT_HOME defined?
I think you'll have to be careful if you are trying the c:\ as your
ANT_HOME - perhaps /cygdrive/c and the rest of the path?
On Tue, 9 Jun 2009, jaybytez wrote:
>
> I just pulled down the latest 1.7.1 to try and resolve an issue I have been
> having lately with my Ant instance 1.7.0.
>
> I am not sure if I should really be posting this on Cygwin's forum, but I
> can open an instance of DOS prompt and type ant -version and correctly get
> the version echoed to the screen. If I open up a cygwin window and type ant
> -version, I get the following error:
>
> $ ant -version
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/
> launch/Launcher
> Caused by: java.lang.ClassNotFoundException:
> org.apache.tools.ant.launch.Launche
> r
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>
> My ANT_HOME is set correctly, and I include ANT_HOME/bin in the PATH
> environment variable as well.
>
> Is there anything else I should be looking at to resolve this?
>
> Thanks, jay
> --
> View this message in context: http://www.nabble.com/Ant-works-in-Dos-Window-but-not-Cygwin-Window-tp23948225p23948225.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org