From ef615cf1c70f3024fdf76c575f2b64fb91738e5e Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Sun, 30 Oct 2022 23:18:51 +0800 Subject: [PATCH] 07env-install-centos.sh --- 00base/07env-install-centos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/00base/07env-install-centos.sh b/00base/07env-install-centos.sh index 7e703cc..2c7c6be 100644 --- a/00base/07env-install-centos.sh +++ b/00base/07env-install-centos.sh @@ -367,6 +367,7 @@ 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 @@ -374,8 +375,7 @@ 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} - 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 + echo '$add_profile' >> /etc/profile source /etc/profile fi java -version