I've installed ANT via yum but it's to old of a version. Not sure how to install it on it's own.
-
@chris-s: managing the hardware or software of servers, workstations, storage or networks - About Software of Servers, so it was on scope. – Brad Feb 09 '16 at 20:24
-
you missed the `within the scope defined by the community` part. Thanks for the feedback. – Chris S Feb 29 '16 at 16:33
3 Answers
As Khaled said you can install from source. This is what I do -
I have a directory structure like
/opt/java/apache/
Under which I have the apache-ant-X.X.X source directory
Then I create a symbolic link to the above: ln -s apache-ant-X.X.X ant
resulting in
/opt/java/apache/ant
(Similarly I have downloaded the JDK and created a symbolic link at /opt/java/jdk)
Then I create /etc/profile.d/java.sh which contains:
export JAVA_HOME=/opt/java/jdk
export ANT_HOME=/opt/java/apache/ant
export PATH=${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}
Hope this helps.
![](../../users/profiles/13993.webp)
- 4,827
- 4
- 22
- 31
For any open source package, you can always download the latest version from the package's website. Then, you can build your own rpm file or install it directly from source.
If you are lucky, you may find an already built rpm for you. Try to search for one!
![](../../users/profiles/58024.webp)
- 35,688
- 8
- 69
- 98
-
Here's a good resource for fidning rpm: http://rpm.pbone.net/. It shows that ant-1.8 is available for CentOS/RHEL 5 via jpackage repo. – rvs Mar 24 '12 at 08:59
If you want to use yum, and still get the most up-to-date package, you need to update you yum configuration files to find RPMs in the vendor repository (Apache here). Many of the vendors has a RPM in their site that sets this configuration for you.
![](../../users/profiles/115255.webp)
- 111
- 2