define the environment variable JAVA_HOME

1.9k Views Asked by At

where can I define the environment variable JAVA_HOME (export JAVA_HOME=path)? I'm using ubuntu 11.10 thanks for help

2

There are 2 best solutions below

0
On

Add it to the bottom of your ~/.bashrc file

1
On

If you want to set it only for your user, it should be under : ~/.pam_environment - This file is specifically meant for setting a user's environment. It is not a script file, but rather consists of assignment expressions, one per line.

If you want to set it system-wide it should be under : /etc/environment - This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line. Specifically, this file stores the system-wide locale and path settings.

All the information and details can be found at : Environment Variables