Browse Source

Update jdk

lj2007331@gmail.com 6 years ago
parent
commit
b7d08a2627
5 changed files with 43 additions and 11 deletions
  1. 2 2
      README.md
  2. 1 1
      include/check_download.sh
  3. 32 0
      include/jdk-11.0.sh
  4. 2 2
      install.sh
  5. 6 6
      versions.txt

+ 2 - 2
README.md

@@ -1,6 +1,6 @@
 [![PayPal donate button](https://img.shields.io/badge/paypal-donate-green.svg)](https://paypal.me/yeho) [![支付宝捐助按钮](https://img.shields.io/badge/%E6%94%AF%E4%BB%98%E5%AE%9D-%E5%90%91TA%E6%8D%90%E5%8A%A9-green.svg)](https://static.oneinstack.com/images/alipay.png) [![微信捐助按钮](https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-%E5%90%91TA%E6%8D%90%E5%8A%A9-green.svg)](https://static.oneinstack.com/images/weixin.png)
 
-This script is written using the shell, in order to quickly deploy `LEMP`/`LAMP`/`LNMP`/`LNMPA`/`LTMP`(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP, JAVA), applicable to CentOS 6 ~ 7(including redhat), Debian 6 ~ 9, Ubuntu 12 ~ 16, Fedora 27~28 of 32 and 64.
+This script is written using the shell, in order to quickly deploy `LEMP`/`LAMP`/`LNMP`/`LNMPA`/`LTMP`(Linux, Nginx/Tengine/OpenResty, MySQL in a production environment/MariaDB/Percona, PHP, JAVA), applicable to CentOS 6 ~ 7(including redhat), Debian 6 ~ 9, Ubuntu 12 ~ 18, Fedora 27~28 of 32 and 64.
 
 Script properties:
 - Continually updated, Provide Shell Interaction and Autoinstall
@@ -10,7 +10,7 @@ Script properties:
 - Providing multiple PHP versions (PHP-7.2, PHP-7.1, PHP-7.0, PHP-5.6, PHP-5.5, PHP-5.4, PHP-5.3)
 - Provide Nginx, Tengine, OpenResty and ngx_lua_waf
 - Providing a plurality of Tomcat version (Tomcat-9, Tomcat-8, Tomcat-7, Tomcat-6)
-- Providing a plurality of JDK version (JDK-10, JDK-1.8, JDK-1.7, JDK-1.6)
+- Providing a plurality of JDK version (JDK-11.0, JDK-1.8, JDK-1.7, JDK-1.6)
 - Providing a plurality of Apache version (Apache-2.4, Apache-2.2)
 - According to their needs to install PHP Cache Accelerator provides ZendOPcache, xcache, apcu, eAccelerator. And php encryption and decryption tool ionCube, ZendGuardLoader, swoole, xdebug, Composer
 - Installation Pureftpd, phpMyAdmin according to their needs

+ 1 - 1
include/check_download.sh

@@ -82,7 +82,7 @@ checkDownload() {
       case "${jdk_option}" in
         1)
           echo "Download JDK 10..."
-          JDK_FILE="jdk-${jdk10_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
+          JDK_FILE="jdk-${jdk110_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
           ;;
         2)
           echo "Download JDK 1.8..."

+ 32 - 0
include/jdk-11.0.sh

@@ -0,0 +1,32 @@
+#!/bin/bash
+# Author:  yeho <lj2007331 AT gmail.com>
+# BLOG:  https://blog.linuxeye.cn
+#
+# Notes: OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+
+#
+# Project home page:
+#       https://oneinstack.com
+#       https://github.com/lj2007331/oneinstack
+
+Install-JDK110() {
+  pushd ${oneinstack_dir}/src > /dev/null
+  JDK_FILE="jdk-${jdk110_ver}_linux-${SYS_BIT_j}_bin.tar.gz"
+  JAVA_dir=/usr/java
+  JDK_NAME="jdk-${jdk110_ver}"
+  JDK_PATH=${JAVA_dir}/${JDK_NAME}
+  [ "${PM}" == 'yum' ] && [ -n "`rpm -qa | grep jdk`" ] && rpm -e `rpm -qa | grep jdk`
+  [ ! -e ${JAVA_dir} ] && mkdir -p ${JAVA_dir}
+  tar xzf ${JDK_FILE} -C ${JAVA_dir}
+  if [ -d "${JDK_PATH}" ]; then
+    [ -z "`grep ^'export JAVA_HOME=' /etc/profile`" ] && { [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo  "export JAVA_HOME=${JDK_PATH}" >> /etc/profile || sed -i "s@^export PATH=@export JAVA_HOME=${JDK_PATH}\nexport PATH=@" /etc/profile; } || sed -i "s@^export JAVA_HOME=.*@export JAVA_HOME=${JDK_PATH}@" /etc/profile
+    [ -z "`grep ^'export CLASSPATH=' /etc/profile`" ] && sed -i "s@export JAVA_HOME=\(.*\)@export JAVA_HOME=\1\nexport CLASSPATH=\$JAVA_HOME/lib/tools.jar:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib@" /etc/profile
+    [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep '$JAVA_HOME/bin' /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=\$JAVA_HOME/bin:\1@" /etc/profile
+    [ -z "`grep ^'export PATH=' /etc/profile | grep '$JAVA_HOME/bin'`" ] && echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile
+    . /etc/profile
+    echo "${CSUCCESS}$JDK_NAME installed successfully! ${CEND}"
+  else
+    echo "${CFAILURE}JDK install failed, Please contact the author! ${CEND}"
+    kill -9 $$
+  fi
+  popd
+}

+ 2 - 2
install.sh

@@ -896,8 +896,8 @@ esac
 # JDK
 case "${jdk_option}" in
   1)
-    . include/jdk-10.sh
-    Install-JDK10 2>&1 | tee -a ${oneinstack_dir}/install.log
+    . include/jdk-11.0.sh
+    Install-JDK110 2>&1 | tee -a ${oneinstack_dir}/install.log
     ;;
   2)
     . include/jdk-1.8.sh

+ 6 - 6
versions.txt

@@ -35,19 +35,19 @@ percona55_ver=5.5.61-38.13
 
 alisql_ver=5.6.32-9
 
-pgsql_ver=10.5
+pgsql_ver=11.0
 
 mongodb_ver=4.0.3
 
 # JDK
-jdk10_ver=10.0.2
-jdk18_ver=1.8.0_181
+jdk110_ver=11.0.1
+jdk18_ver=1.8.0_192
 jdk17_ver=1.7.0_80
 jdk16_ver=1.6.0_45
 
 # PHP
-php72_ver=7.2.10
-php71_ver=7.1.22
+php72_ver=7.2.11
+php71_ver=7.1.23
 php70_ver=7.0.32
 php56_ver=5.6.38
 php55_ver=5.5.38
@@ -78,7 +78,7 @@ xdebug_ver=2.6.1
 pureftpd_ver=1.0.47
 
 # Redis
-redis_ver=4.0.11
+redis_ver=5.0.0
 redis_pecl_ver=4.1.1
 
 # Memcached