qq_43770367
qq_43770367
采纳率0%
2018-11-23 12:44

(小白求救)linux上安装jiava,添加环境

bash: /etc/profile: 行 31: 语法错误: 未预期的文件结尾
root@lax-OMEN-by-HP-Laptop-15-ce0xx:/home/lax# vim /etc/profile
root@lax-OMEN-by-HP-Laptop-15-ce0xx:/home/lax# . /etc/profile
bash: /etc/profile: 行 31: 语法错误: 未预期的文件结尾

 以上是我遇到的错误,下面是我的/etc/profile文件修改的内容,就是按照网上的教程修改了文件地址添加的,总是遇到语法错我,我还不会shell语法啊!!!!,我linux都是刚接触不久................还没入门呢.........麻烦好心人救救我.............

# /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

if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
#Java Env
export JAVA_HOME=/home/lax/下载/jdk1.8.0_191
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

相关推荐