centos使用source命令提示notavalia identitier怎么办?
1、centos下配置jdk环境变量。切换至/etc下,使用命令:cd /etc

2、Xshell配合Xftp打开该目录:

3、查找到profile文件:

4、使用记事本开始,在末尾添加:
export JAVA_HOME=/usr/local/java/jdk1.7.0_79
export JRE_HOME=/usr/local/java/jdk1.7.0_79/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin: $PATH

5、使用source命令使其生效。命令:source /etc/profile

6、错误原因:刚才编辑的有空格。认真检查:

7、 去掉空格。再次使用source命令。就可以了。
【文章原创作者:阿里云代理商 http://www.558idc.com/aliyun.html 网络转载请说明出处】