Monday, 9 April 2012

How to set JAVA_HOME environment variable in Ubuntu


    Open /etc/bash.bashrc using sudo command
    e.g. sudo gedit /etc/bash.bashrc.
   
   go to the end of the file and add following lines:

    JAVA_HOME=/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)
    export JAVA_HOME
   
    PATH=$PATH:$JAVA_HOME/bin
    export PATH

   Done. Just reboot your computer.


    echo $JAVA_HOME
    it shows something like this:/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)
 
    echo $PATH
    it shows something like this::/usr/lib/jvm/name_of_your_java_folder(e.g. java,open-6-jdk etc.)/bin 

No comments:

Post a Comment