It looks like Ubuntu uses ~/.bashrc
, ~/.bash_profile
, ~/.pam_profile
, /etc/environment
, and /etc/profile
in very
Firstly, it's standard practice to omit the trailing slash when setting env variables on *nix. (You have a trailing slash at the end of yours). So you should write:
export ANT_HOME=/opt/apache/ant/1.8.4/apache-ant-1.8.4
... and not:
export ANT_HOME=/opt/apache/ant/1.8.4/apache-ant-1.8.4/
~/.bashrc, ~/.bash_profile are good if you only care about your user account and you use the bash shell. For setting an environment variable, it doesn't really make much difference which of these you use. .bashrc would reset it every time you opened a new shell, whereas .bash_profile would reset it every time you logged-in.
The files in /etc would set it for all users on your system (but it could be overridden locally). If you're going to have different users building and you want them all to have the same environment varilables, then /etc/profile would be a good place to put it.