Ubuntu – Setting JAVA_HOME on Ubuntu 10.x


I'm trying to get the Rhodes framework installed so I can develop Android apps.

This requires that I install the SUN JDK and add JAVA_HOME and JAVA_HOME/bin to path.

I thought I could solve this by editing my bash.bashrc file:

export JAVA_HOME

This still doesn't work, because when I run:

rake run:android

I get a prompt in the console that says the Java bin was not found in my path.

However, running echo $PATH gets me:

usernamee@ubuntu:~$ echo $PATH

What are my options here?

Edit: If the problem is not the export statement, how can I ensure that the Sun JDK is properly installed and that I am, in fact, pointing to the correct path in bashrc?

Best Answer

Try removing the export statement:

JAVA_HOME = /path/to/java

Then echo $JAVA_HOME in a new terminal to make sure you've got things exported correctly.


Alternatively, try this:

export JAVA_HOME=/path/to/java
export PATH=$PATH:$JAVA_HOME/bin