You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Yves S. Garret" <yo...@gmail.com> on 2013/04/02 19:37:58 UTC

Can't get ant to install...

Hi all, I'm trying to install ant.

After using sudo, I ran this command and this is the result that I got:

$ sudo ./build.sh -Dant.install=/usr/bin
[sudo] password for developer:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.apache.tools.ant.launch.Launcher.
Program will exit.

Ok... not what I wanted.  Then, just for kicks, this is what I decided to
do:

$ ./build.sh -Dant.install=/usr install
Buildfile:
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml

install:

prepare:

check_for_optional_packages:

build:
Copying 2 files to
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/classes

jars:
Building jar:
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant.jar

dist-lite:
Copying 21 files to /usr/lib

BUILD FAILED
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:1403:
The following error occurred while executing this line:
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:877:
Failed to copy
/home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant-antlr.jar
to /usr/lib/ant-antlr.jar due to java.io.FileNotFoundException
/usr/lib/ant-antlr.jar (Permission denied)

Total time: 7 seconds


And that's not surprising.  I do want ant to be installed in /usr/bin, but
get that funky Java error when I try.

Why is that?

How can I instally ant-1.9 on my CentOS 6.3 machine?  No, it was not
pre-installed :) .

Re: Can't get ant to install...

Posted by "Yves S. Garret" <yo...@gmail.com>.
Hi, thanks for your reply.

I was able to install a different version of ant from yum.  This issue is
resolved.

On Tue, Apr 2, 2013 at 8:11 PM, Martin Gainty <mg...@hotmail.com> wrote:

> J2SE 7 = 51,
> J2SE 6.0 = 50,
> J2SE 5.0 = 49,
> JDK 1.4 = 48,
> JDK 1.3 = 47,
> JDK 1.2 = 46,
> JDK 1.1 = 45
> echo $JAVA_HOMEyou'll need to (re)compile all of your java classes with
> the same JDK (from  $JAVA_HOME)that your JRE runs with $JAVA_HOME\jreIn
> other words
> javac -version java -version
> should be the same version
> after I untar ANT i set $ANT_HOME to the location of untared folder
> place $ANT_HOME\bin on $PATH
>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>  > Date: Tue, 2 Apr 2013 13:37:58 -0400
> > Subject: Can't get ant to install...
> > From: yoursurrogategod@gmail.com
> > To: user@ant.apache.org
> >
> > Hi all, I'm trying to install ant.
> >
> > After using sudo, I ran this command and this is the result that I got:
> >
> > $ sudo ./build.sh -Dant.install=/usr/bin
> > [sudo] password for developer:
> > Exception in thread "main" java.lang.UnsupportedClassVersionError:
> > org/apache/tools/ant/launch/Launcher : Unsupported major.minor version
> 51.0
> >     at java.lang.ClassLoader.defineClass1(Native Method)
> >     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> >     at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> >     at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> >     at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
> >     at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
> >     at java.security.AccessController.doPrivileged(Native Method)
> >     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
> >     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
> >     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
> >     at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> > Could not find the main class: org.apache.tools.ant.launch.Launcher.
> > Program will exit.
> >
> > Ok... not what I wanted.  Then, just for kicks, this is what I decided to
> > do:
> >
> > $ ./build.sh -Dant.install=/usr install
> > Buildfile:
> > /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml
> >
> > install:
> >
> > prepare:
> >
> > check_for_optional_packages:
> >
> > build:
> > Copying 2 files to
> > /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/classes
> >
> > jars:
> > Building jar:
> >
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant.jar
> >
> > dist-lite:
> > Copying 21 files to /usr/lib
> >
> > BUILD FAILED
> >
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:1403:
> > The following error occurred while executing this line:
> > /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:877:
> > Failed to copy
> >
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant-antlr.jar
> > to /usr/lib/ant-antlr.jar due to java.io.FileNotFoundException
> > /usr/lib/ant-antlr.jar (Permission denied)
> >
> > Total time: 7 seconds
> >
> >
> > And that's not surprising.  I do want ant to be installed in /usr/bin,
> but
> > get that funky Java error when I try.
> >
> > Why is that?
> >
> > How can I instally ant-1.9 on my CentOS 6.3 machine?  No, it was not
> > pre-installed :) .
>
>

RE: Can't get ant to install...

Posted by Martin Gainty <mg...@hotmail.com>.
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45
echo $JAVA_HOMEyou'll need to (re)compile all of your java classes with the same JDK (from  $JAVA_HOME)that your JRE runs with $JAVA_HOME\jreIn other words
javac -version java -version
should be the same version
after I untar ANT i set $ANT_HOME to the location of untared folder
place $ANT_HOME\bin on $PATH

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 > Date: Tue, 2 Apr 2013 13:37:58 -0400
> Subject: Can't get ant to install...
> From: yoursurrogategod@gmail.com
> To: user@ant.apache.org
> 
> Hi all, I'm trying to install ant.
> 
> After using sudo, I ran this command and this is the result that I got:
> 
> $ sudo ./build.sh -Dant.install=/usr/bin
> [sudo] password for developer:
> Exception in thread "main" java.lang.UnsupportedClassVersionError:
> org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 51.0
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> Could not find the main class: org.apache.tools.ant.launch.Launcher.
> Program will exit.
> 
> Ok... not what I wanted.  Then, just for kicks, this is what I decided to
> do:
> 
> $ ./build.sh -Dant.install=/usr install
> Buildfile:
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml
> 
> install:
> 
> prepare:
> 
> check_for_optional_packages:
> 
> build:
> Copying 2 files to
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/classes
> 
> jars:
> Building jar:
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant.jar
> 
> dist-lite:
> Copying 21 files to /usr/lib
> 
> BUILD FAILED
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:1403:
> The following error occurred while executing this line:
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build.xml:877:
> Failed to copy
> /home/developer/Downloads/apache-projects/apache-ant-1.9.0/build/lib/ant-antlr.jar
> to /usr/lib/ant-antlr.jar due to java.io.FileNotFoundException
> /usr/lib/ant-antlr.jar (Permission denied)
> 
> Total time: 7 seconds
> 
> 
> And that's not surprising.  I do want ant to be installed in /usr/bin, but
> get that funky Java error when I try.
> 
> Why is that?
> 
> How can I instally ant-1.9 on my CentOS 6.3 machine?  No, it was not
> pre-installed :) .