• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install apache ant 1.10.3 on Ubuntu 18.04

{{postValue.id}}

To install Apache Ant 1.10.3 on Ubuntu   18.04

Apache Ant  is a Java-based build tool that was developed by Apache Software Foundation, which is used to build files that are written in XML. Apache Ant is a Java library and command line tool so it is required to install Java Development Kit (JDK). This tutorial explains the installation procedure of Apache Ant on Ubuntu. 

Installation

Let’ s First start with updating the system repository. 

root@linuxhelp:~# apt-get update 
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu bionic InRelease 
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done

After updating the system repository proceed to download apache-ant  latest version

root@linuxhelp:~# wget http://www-eu.apache.org/dist//ant/binaries/apache-ant-1.10.3-bin.zip
--2018-04-30 18:42:39--  http://www-eu.apache.org/dist//ant/binaries/apache-ant-1.10.3-bin.zip
Resolving www-eu.apache.org (www-eu.apache.org)... 195.154.151.36, 2001:bc8:2142:300::
Connecting to www-eu.apache.org (www-eu.apache.org)|195.154.151.36|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9011568 (8.6M) [application/zip]
Saving to: ‘ apache-ant-1.10.3-bin.zip’ 

apache-ant-1.10.3-bin.zip      100%[===================================================> ]   8.59M  38.7MB/s    in 0.2s    

2018-04-30 18:43:02 (38.7 MB/s) - ‘ apache-ant-1.10.3-bin.zip’  saved [9011568/9011568]

After Downloading unzip the package to /usr/local directory.

root@linuxhelp:~# unzip apache-ant-1.10.3-bin.zip -d /usr/local/
Archive:  apache-ant-1.10.3-bin.zip
   creating: /usr/local/apache-ant-1.10.3/
   creating: /usr/local/apache-ant-1.10.3/bin/
  inflating: /usr/local/apache-ant-1.10.3/bin/ant  
  inflating: /usr/local/apache-ant-1.10.3/bin/antRun  
  inflating: /usr/local/apache-ant-1.10.3/bin/antRun.pl  
  inflating: /usr/local/apache-ant-1.10.3/bin/complete-ant-cmd.p
.
.
  inflating: /usr/local/apache-ant-1.10.3/manual/tutorial-writing-tasks-src.zip  
  inflating: /usr/local/apache-ant-1.10.3/manual/tutorial-writing-tasks.html  
  inflating: /usr/local/apache-ant-1.10.3/manual/tutorials.html  
  inflating: /usr/local/apache-ant-1.10.3/manual/using.html  
  inflating: /usr/local/apache-ant-1.10.3/manual/usinglist.html  
  inflating: /usr/local/apache-ant-1.10.3/patch.xml  

Now navigate to the extracted directory and rename the file. 

root@linuxhelp:~# cd /usr/local/ 
apache-ant-1.10.3  bin  etc  games  include  lib  man  sbin  share  src
root@linuxhelp:/usr/local# mv apache-ant-1.10.3 apache-ant
root@linuxhelp:/usr/local# ls
apache-ant  bin  etc  games  include  lib  man  sbin  share  src

Next, create a soft link using the following command.

root@linuxhelp:/usr/local# ln -s /usr/local/apache-ant/ /usr/local/ant

Now create Environment Variables for Apache Ant. Create a file called ant.sh inside /etc/profile.d/ directory.

root@linuxhelp:/usr/local# vi /etc/profile.d/ant.sh
export ANT_HOME=/usr/local/ant
export PATH=${ANT_HOME}/bin:${PATH}

After creating environment variables, you need to run the following command to execute the variables.

root@linuxhelp:/usr/local# source /etc/profile

The Apache Ant has been successfully installed. Next, you can check the version of Apache Ant. 

root@linuxhelp:/usr/local# ant -version
Apache Ant(TM) version 1.10.3 compiled on March 24 2018 

With this, the method to  install Apache Ant   1.10.3 on Ubuntu 18.04 comes to an end. 

Tags:
gabriel
Author: 

Comments ( 1 )

gilbertoluismorillo
Hello, i just installed the newest version 1.10.7 but when i run the ant -v command this is the output:
"Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed"
I then tried to locate that build.xml file with ant -find build.xml and couldnt find it.
Any help will be much appreciated!
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

If its possible to install Apache Ant on CentOS?

A

yes, apache ant is avaialble on centos alos
refer the below link for installation
https://www.linuxhelp.com/how-to-install-apache-ant-in-centos-7/

Q

where i can create the environment variables for apache ant?

A

create Environment Variables for Apache Ant by below command
# vi /etc/profile.d/ant.sh

Q

what to do after creating the environment variables of apache ant?

A

After creating environment variables, you need to run the following command to execute the variables.
# source /etc/profile

Q

where to download the apache ant package?

A

Download the apache ant package by following link
#wget http://www-eu.apache.org/dist//ant/binaries/apache-ant-1.10.3-bin.zip

Q

how to check the version of apache ant?

A

use the folowing command to check the version of apache ant
# ant -version

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.