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 :) .

Reply via email to