How to set JAVA_HOME in Ubuntu

JavaI can never remember this, so for mainly for my reference and anybody else who may Google this.

  • Get Java via the Synaptic Update Manager
  • sudo vi /etc/bash.bashrc and add the following to the end of the file:
    JAVA_HOME=/usr/lib/jvm/java-6-sun
    export JAVA_HOME
  • Close your command window and reopen
  • echo $JAVA_HOME to confirm it is set