Solved

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

Posted on 2010-11-12
6
1,175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:stermeau
stermeau earned 167 total points
ID: 34120702
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
ID: 34120964
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
ID: 34125667
so in this case those two tools i already set and working eventhough they're not listed under the /etc/environment ?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 5

Accepted Solution

by:
msmolyak earned 333 total points
ID: 34125681
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
ID: 34125724
yes both of them seems to be working.

thanks for the clarification man.
0
 
LVL 1

Author Closing Comment

by:jjoz
ID: 34125725
thanks man !
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

635 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