Old solution not working for missing Tools.jar while building Portico on Red hat Linux using apache ant

866 views Asked by At

I have already done my homework before posting this question. I am trying to build Portico-1.0.2 on Red-Hat Linux 64 bit machine using apache ant. Initially I was setting JAVA_HOME path to jre-1.6.0_31/bin folder but it threw an error that : Unable to locate tools.jar. Expected to find it in jre1.6.0_31/lib/tools.jar.

Then after exploring stackoverflow I found few posts explaining to install jdk and set its folder as the JAVA_HOME path. So I have installed Jdk-1.6.0 in Redhat Linux and after installing jdk I located tools.jar file in it's lib folder. Now when I set the JAVA_HOME path to : /usr/lib/jvm/jre-1.6.0-openjdk.x86_64, it throws an error : portico-1.0.2/codebase/build.xml:55: The JAVA_HOME environment variable must be set

But I have set the JAVA_HOME in .bashrc file as follows :

JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
PATH=$JAVA_HOME:$PATH

I am not sure what to do. Any advice on how to solve this problem.

2

There are 2 answers

0
Mark O'Connor On

Confusingly the JDK also contains a JRE, the latter you've set as JAVA_HOME thereby repeating your problem...

The Red hat docs describe how to set the JAVA_HOME

0
Praveen Kumar On

hi open the bashrc file in the root directory and add the path to your jdk and you will be good to go..

eg

export JAVA_HOME=/usr/java/jdk1.6.0_19

export PATH=$PATH:$JAVA_HOME/bin