Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-12-2010, 02:49 AM   #1
Registered: Aug 2010
Posts: 50

Rep: Reputation: 1
Question How to set Ant and Java Home ?

Hi All,

I've successfully installed Java and Ant using apt-get, however when i tried to echo the env. variable, I doesn't give me anything ?

But, i can see some result here:
root@SSV:~# java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

root@SSV:~# ant
Buildfile: build.xml does not exist!
Build failed
is that working configuration or i shall add it into /etc/environment file like the following ?

root@SSV:~# whereis ant
ant: /usr/bin/ant /usr/share/ant /usr/share/man/man1/ant.1.gz

root@SSV:~# whereis java
java: /usr/bin/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
Any help would be greatly appreciated.


Old 11-12-2010, 10:51 PM   #2
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
You may want to set the ANT_HOME and JAVA_HOME environment variables, but other that than it looks like it is working.

You can always test it out, put both files in a directory and run ant.
class test1
   public void main()
<?xml version="1.0"?>

<project name="test1" default="all">

        <target name="compile">
                <echo message="Compiling..."/>
                <javac srcdir="." destdir="." includes="" />

        <target name="all" depends="clean,compile"/>

        <target name="clean">
                <echo message="Cleaning..."/>
                <delete failonerror="false">
                        <fileset dir="." includes="test1.class"/>

1 members found this post helpful.
Old 11-12-2010, 11:08 PM   #3
Registered: Aug 2010
Posts: 50

Original Poster
Rep: Reputation: 1
wow, thank you very much man, I learn so much with this way.


ant, environment variable, java, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up Ant JosephS Slackware 1 09-01-2008 01:34 PM
how to set up path,classpath,catalina home for java in fedora -9 vicky7038 Linux - Software 1 08-19-2008 08:41 AM
ant limewire and java kevner Slackware 3 06-29-2005 07:48 AM
Ant & args for java acjt Programming 1 04-25-2004 12:01 AM
java ant tomcat j-ray Linux - Software 1 09-12-2002 11:59 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration