Monthly Archives: May 2014

How to set JAVA_HOME on Linux

    1. Login to the system
    2. Open a terminal window
    3. Open .bash_profile file for editing
      # vim ~/.bash_profile
    4. Set JAVA_HOME as following: export JAVA_HOME=<path to java>
      export JAVA_HOME=/usr/bin/java
    5. Set PATH as following:
      export PATH=$PATH:/usr/bin/java
    6. Save and close the file. Relogin in order to apply changes
    7. Alternatively use the following to activate new changes:
      # source ~/.bash_profile
      # . ~/.bash_profile

TIP: To find out exact path of java executable use the command as follows:
# which java