You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frank Gunseor <fd...@gmail.com> on 2008/07/04 17:39:57 UTC

newbie question regarding setting environment variables

I have ant install on Ubuntu 8.04.

When I try to run ant I get an error message, "Unable to locate tools.jar,
etc.".

I expect that I have to set JAVA_HOME, but for the life of me I can not
figure out where or how.

I have checked the manual, the FAQ, etc. I guess I'm just being dense today.

Can someone help?

Thank you.

FDG

RE: newbie question regarding setting environment variables

Posted by "Frank D. Gunseor" <fd...@verizon.net>.
supareno,

Thank you! Thank you! Thank you!

That was exactly what I needed.

I have got to get back to thinking in Linux! Windows ruined me!

Again, after following your directions, it worked perfectly.

FDG

-----Original Message-----
From: supareno [mailto:reno.rkcrew@free.fr] 
Sent: Friday, July 04, 2008 1:29 PM
To: Ant Users List
Subject: Re: newbie question regarding setting environment variables

Frank,

can you give us the result of 'ant -diagnostics'  or 'ant -diagnostics |
grep tools' to see tools.jar is in your path if not, what is the result of
'echo $JAVA_HOME'?

to set your JAVA_HOME:

edit your bashrc file
vi ~/.bashrc

add these lines at the end your bashrc file ...

PATH=/<path_to_your_jdk>/bin:$PATH
JAVA_HOME=/<path_to_your_jdk>/
JDK_HOME=/<path_to_your_jdk>/

export PATH
export JAVA_HOME
export JDK_HOME

save your changes

[ <esc> + : + w + q ] in the vi editor

reload your bashrc file (not sure that is useful)

source ~/.bashrc

try echo $JAVA_HOME
you must see /<path_to_your_jdk>/

and after try ant -diagnostics

hope this help

supareno

> I have ant install on Ubuntu 8.04.
>
> When I try to run ant I get an error message, "Unable to locate 
> tools.jar, etc.".
>
> I expect that I have to set JAVA_HOME, but for the life of me I can 
> not figure out where or how.
>
> I have checked the manual, the FAQ, etc. I guess I'm just being dense
today.
>
> Can someone help?
>
> Thank you.
>
> FDG
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
commands, e-mail: user-help@ant.apache.org

No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.134 / Virus Database: 270.4.5/1533 - Release Date: 7/3/2008
7:19 PM


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: newbie question regarding setting environment variables

Posted by supareno <re...@free.fr>.
Frank,

can you give us the result of 'ant -diagnostics'  or 'ant -diagnostics | 
grep tools' to see tools.jar is in your path
if not, what is the result of 'echo $JAVA_HOME'?

to set your JAVA_HOME:

edit your bashrc file
vi ~/.bashrc

add these lines at the end your bashrc file
...

PATH=/<path_to_your_jdk>/bin:$PATH
JAVA_HOME=/<path_to_your_jdk>/
JDK_HOME=/<path_to_your_jdk>/

export PATH
export JAVA_HOME
export JDK_HOME

save your changes

[ <esc> + : + w + q ] in the vi editor

reload your bashrc file (not sure that is useful)

source ~/.bashrc

try echo $JAVA_HOME
you must see /<path_to_your_jdk>/

and after try ant -diagnostics

hope this help

supareno

> I have ant install on Ubuntu 8.04.
>
> When I try to run ant I get an error message, "Unable to locate tools.jar,
> etc.".
>
> I expect that I have to set JAVA_HOME, but for the life of me I can not
> figure out where or how.
>
> I have checked the manual, the FAQ, etc. I guess I'm just being dense today.
>
> Can someone help?
>
> Thank you.
>
> FDG
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: newbie question regarding setting environment variables

Posted by Henning Bredel <h....@gmx.de>.
> I expect that I have to set JAVA_HOME, but for the life of me I can not
> figure out where or how.

For a session you can type

JAVA_HOME=<path to your java JDK>

Note that you have to set the path to your JDK, not the JRE.

Setting the path permanent, you can alter your ~/.profile 
(in your /home/<username> dir). Type here at the bottom

export JAVA_HOME=<path to your java JDK>

and add optionally to your path

export PATH=JAVA_HOME/bin:$PATH

Regards

  Henning