Installing ANT on Ubuntu

Hi All,

Installing ANT on Ubuntu is fairly very simple. All We have to do is to open the terminal window. And simply run the below command.

sudo apt-get -u install ant

Once you run the command You will be prompted for the admin password and the installation begin.. Once Done simply type ANT in the terminal..

Hope this Helps.

R Vashi

12 thoughts on “Installing ANT on Ubuntu

  1. ayola

    I get an error message saying “Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar”

    1. ®V Post author


      do you have jdk installed in your ubuntu OS.

      Verify in the below steps:

      1. open terminal

      2. type “java -version” and press enter. if you are able to see the JDK version information then use the below 3rd step otherwise go to step 4.

      3. Set JAVA_HOME into environment variable, Copy following statement and append to /etc/profile or .bashrc file, make system set JAVA_HOME into system environment variable.
      export JAVA_HOME=”/usr/lib/jvm/java-6-sun-;”

      4 You need to setup JDK. Open the terminal, and type the below command.
      apt-get install sun-java6-jdk sun-java6-jre
      Once installation done, you can perform the step 3 to set the java_home.

      Hope this helps

      R Vashi

  2. vivek

    in my terminal apt-get -u install ant give some warning (libjaxp1.3-java libxerces2-java ant libgcj-common gcj-4.4-base libgcj10 libgcj-bc ant-gcj ant-optional ant-optional-gcj
    gcj-4.4-jre-lib) after that give this type of error (Err lucid/main libjaxp1.3-java 1.3.04-5ubuntu3
    407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )

    1. ®V Post author

      Hi Vivek,

      Apologies was just away for few days and couldn’t saw your comment.. Please let me know if your prob is still there..

  3. Minakshi

    I have install Ant 1.8.2 successfully using sudo apt-get -u install ant command.

    but it gives error when I try to open it by typing ANT in terminal
    error: Buildfile: build.xml does not exist!
    Build failed

    whats going wrong here..
    plz help.

    1. ®V Post author

      The moment you run the “ANT” command it looks for BUILD.XML(ant script) at same location, Please make sure you have the same before running that.

      Hope this helps.

  4. anh thai

    I used ubun server 12.04 and I want to install ant but i can’t
    I used sudo apt-get -u install ant command and ERROR package ‘ant’ has no installation candidate
    can You help me?


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.