使用vi ~/.bash_profile 命令在.bash_profile添加环境变量如下 :
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
[fyqjnu@localhost ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/home/fyqjnu/software/jdk1.6.0_05
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.
export PATH
增加 JAVA_HOME PATH CLASSPATH 三个变量。
但发现eclipse还是启动不了,可能是、/etc/selinux/config 文件的SELINUX的值有问题,将其改成disable