Ubuntu Jenkins path셋팅

1 minute read

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”.

sunjdk6 /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-su$

openjdk6 /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-amd64

sunjdk6 /usr/lib/jvm/java-6-sun

openjdk7 /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/java-7-openjdk-amd64

maven /usr/share/maven

ant /usr/bin/ant /usr/share/ant