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.

  1. Find the location of your jvm. ex: /usr/lib/jvm/java-6-sun/
  2. 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):

    
    JAVA_HOME=/usr/lib/jvm/java-6-sun/
    
  3. Log out, and log back in.
  4. Open a terminal and run “echo $JAVA_HOME”, which should give you /usr/lib/jvm/java-6-sun/
Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

  1. Installing Memcached on Ubuntu for PHP
  2. What Happens with MySQL? VirtualBox? Java?
  3. Localhost Subdomains on Ubuntu
  4. Why Not To Use Sudo Graphically
  5. Is Prism, JavaFX, and Air Such a Big Deal?