How To Set JAVA_HOME in Ubuntu
By trent on 10 Feb in Linux
This post is more for my memory than anything. I always forget and need to dig around to figure out how (or more importantly “where”) to set JAVA_HOME in Ubuntu. It’s pretty simple.
- Find the location of your jvm. ex: /usr/lib/jvm/java-6-sun/
- Add a line to your environment file:
sudo pico /etc/environment
Then just add the following to the end (or whatever the location of your jvm was):
- Log out, and log back in.
- Open a terminal and run “echo $JAVA_HOME”, which should give you /usr/lib/jvm/java-6-sun/