阅读背景:

ubuntu设置环境变量位置_孤竹的博客_ubuntu环境变量

来源:互联网 


我的ubuntu  在/etc/profile中设置

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
	# java Environment Path
	export JAVA_HOME=/usr/lib/jvm/jdk1.8/
	export PATH=$JAVA_HOME/bin:$PATH
	# ant Environment Path
	export ANT_HOME=/usr/hadoop/ant/
	export PATH=$ANT_HOME/bin:$PATH

  unset i
fi
# /etc/profile



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: