How to set ANT_HOME on Ubuntu Desktop 12.04?

前端 未结 6 1604
时光取名叫无心
时光取名叫无心 2021-02-09 08:12

It looks like Ubuntu uses ~/.bashrc, ~/.bash_profile, ~/.pam_profile, /etc/environment, and /etc/profile in very

6条回答
  •  无人及你
    2021-02-09 08:53

    For global settings, system-wide environment variables

    • Use /etc/environment
    • don't use /etc/profile, or /etc/bash.bashrc

    From this page :

    /etc/environment [...] 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.

    Using /etc/profile is a very Unix-y way to go, but its functionality is greatly reduced under Ubuntu. It exists only to point to /etc/bash.bashrc and to collect entries from /etc/profile.d .

    On my system, the only interesting entry entry in profile.d is /etc/profile.d/bash_completion.sh .

    For local or per-user settings

    A previous version of the Ubuntu page recommended ~/.pam_environment , but the page currently suggests that if that doesn't work, you should use

    • ~/.profile - This is probably the best file for placing environment variable assignments in, since it gets executed automatically by the DisplayManager during the startup process desktop session as well as by the login shell when one logs-in from the textual console.

    • ~/.bash_profile or ~./bash_login - If one of these exists, bash executes it instead of "~/.profile" when bash is started as a login shell. Bash will prefer ~/.bash_profile to ~/.bash_login. [...] These files won't influence a graphical session by default."

    • ~/.bashrc - "... may be the easiest place to set variables".

提交回复
热议问题