Solved

How to setup ANT & JAVA Home in Ubuntu Linux 64 bit ?

Posted on 2010-11-12
6
1,124 Views
Last Modified: 2012-05-10
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

Open in new window



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
root@SSV:~#

Open in new window


Any help would be greatly appreciated.

Thanks
0
Comment
Question by:jjoz
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:stermeau
stermeau earned 167 total points
Comment Utility
Hi,
I am not sure what you are expecting to see in the env variable.
From your comment, you are trying to build a project but ant cannot find the build.xml file. This has nothing to do with the env variable.
Try to locate the build.xml file and run the ant command from the folder where the file is located.
You can use the following to locate the file:
  sudo updatedb
  sudo locate build.xml
0
 
LVL 5

Assisted Solution

by:msmolyak
msmolyak earned 333 total points
Comment Utility
Your Ant installation is actually working. This is Ant running and telling you that it has nothing to build. To echo an environment variable use

echo $JAVA_HOME

You need to set ANT_HOME to point to the root of your Ant installation.

export ANT_HOME=/your/path/here

Make sure to add ant/bin directory to your path.

To run Ant use

ant build.xml

where build.xml is the name of the build file. This is actually a default name, so it can be skipped (if the file is named build.xml and is in the current directory).

Follow an Ant tutorial (e.g., http://www.roseindia.net/tutorials/ant/) for further steps.

Michael
0
 
LVL 1

Author Comment

by:jjoz
Comment Utility
so in this case those two tools i already set and working eventhough they're not listed under the /etc/environment ?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Accepted Solution

by:
msmolyak earned 333 total points
Comment Utility
Ant is apparently working since you are getting a response. To make sure create a simple build file (with a single target with an echo task) and run Ant from the directory where the file resides.

Running 'java -version' will tell you whether Java is set up correctly.
0
 
LVL 1

Author Comment

by:jjoz
Comment Utility
yes both of them seems to be working.

thanks for the clarification man.
0
 
LVL 1

Author Closing Comment

by:jjoz
Comment Utility
thanks man !
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now