diff --git a/00base/07env-install-centos.sh b/00base/07env-install-centos.sh index eb4de89..7e703cc 100644 --- a/00base/07env-install-centos.sh +++ b/00base/07env-install-centos.sh @@ -367,7 +367,6 @@ function init:java() { local host="127.0.0.1" local java_path="${BASE_DIR}/java/${JDK_DIR_NAME}" local line="\n" - local add_profile=`echo -e "${line}JAVA_HOME=${java_path}${line}PATH=\$JAVA_HOME/bin:\$PATH${line}export JAVA_HOME PATH"` command::exec "${host}" " yum -y remove *openjdk* if [ ! -d "$java_path" ]; then @@ -375,9 +374,8 @@ function init:java() { wget --timeout=10 --waitretry=3 --tries=5 --retry-connrefused --no-check-certificate ${JDK_URL} -O ${BASE_DIR}/java/${JDK_FILE_NAME} cd ${BASE_DIR}/java tar -zxvf ${JDK_FILE_NAME} - fi - if [ \`grep -c '$add_profile' '/etc/profile'\` == '0' ];then - echo '$add_profile' >> /etc/profile + local add_profile=`echo -e "${line}JAVA_HOME=${java_path}${line}PATH=\$JAVA_HOME/bin:\$PATH${line}export JAVA_HOME PATH"` + echo '\$add_profile' >> /etc/profile source /etc/profile fi java -version