Setting JAVA_HOME in Ubuntu

I had spent a lot of time setting the $PATH on my Ubuntu but i forgot to document the procedure. So when my friend asked me, i wasn’t able to help him out. So this time i asked him to tell the solution so that i could note it down. The best place would be my blog.

export JAVA_HOME
export PATH

Source: The Ubuntu Guy.

Categories: Ubuntu

Tags: , , ,

5 replies

  1. What file do you insert this text into?


  2. these commands are used at the command prompt if i am not wrong.


  3. I hope export will work only with bash prompt. Better to mention it to avoid confusion


  4. Thanks, this actually works. The problem is when I reboot to Ubuntu the variables are no longer set. How do I set it permanently?
    Harlan. (new to Ubuntu)


    • U can set u’r environment vairables in the file .bash_aliases which is there in user’s home directory. The file would contain-

      export PATH

      U can also add other environment variables like CLASSPATH. Note that the other bin dir paths are for u’r shell commands. After editing this file restart your terminal. Hope this helps.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: