This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new 7fa1d27  [KARAF-5641] Karaf boot scripts need to deal with JDK10 
version patterns
7fa1d27 is described below

commit 7fa1d274bda958e5ff24d0ab74aa6c19b534a35e
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Tue Mar 13 21:28:32 2018 +0100

    [KARAF-5641] Karaf boot scripts need to deal with JDK10 version patterns
---
 .../src/main/filtered-resources/resources/bin/inc  | 30 ++--------------------
 .../main/filtered-resources/resources/bin/karaf    |  2 +-
 2 files changed, 3 insertions(+), 29 deletions(-)

diff --git 
a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc 
b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
index 14a42e6..8e73df2 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/inc
@@ -208,18 +208,8 @@ detectJVM() {
 }
 
 checkJvmVersion() {
-    VERSION=$("${JAVA}" -version 2>&1 \
-        | egrep '"([0-9].[0-9]\..*[0-9]).*"' \
-        | awk '{print substr($3,2,length($3)-2)}' \
-        | awk '{print substr($1, 3, 3)}' \
-        | sed -e 's;\.;;g')
-    MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
-        |awk -F '"' '/version/ {print $2}' \
-        |cut -b 1)
-    if [ "${MAJOR_VERSION}" -ge "9" ]; then
-       VERSION=90
-    fi
-    if [ "${VERSION}" -lt "80" ]; then
+    VERSION=$("${JAVA}" -version 2>&1 | awk -F '"' '/version/ {print $2}' | 
sed -e 's/_.*//g; s/^1\.//g ; s/\..*//g;')
+    if [ "${VERSION}" -lt "8" ]; then
         die "JVM must be greater than 1.8"
     fi
 }
@@ -263,22 +253,6 @@ setupDefaults() {
 
     #Set the JVM_VENDOR specific JVM flags
     if [ "${JVM_VENDOR}" = "SUN" ]; then
-        # permgen was removed in Java 8
-        VERSION=$("${JAVA}" -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' 
| awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | 
sed -e 's;\.;;g')
-        MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
-            |awk -F '"' '/version/ {print $2}'|cut -b 1)
-        if [ "${MAJOR_VERSION}" -ge "9" ]; then
-           VERSION=90
-        fi
-        if [ "${VERSION}" -lt "80" ]; then
-            # Check some easily accessible MIN/MAX params for JVM mem usage
-            if [ "x${JAVA_PERM_MEM}" != "x" ]; then
-                DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} 
-XX:PermSize=${JAVA_PERM_MEM}"
-            fi
-            if [ "x${JAVA_MAX_PERM_MEM}" != "x" ]; then
-                DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} 
-XX:MaxPermSize=${JAVA_MAX_PERM_MEM}"
-            fi
-        fi
         DEFAULT_JAVA_OPTS="${DEFAULT_JAVA_OPTS} -Dcom.sun.management.jmxremote"
     elif [ "${JVM_VENDOR}" = "IBM" ]; then
         if ${os400}; then
diff --git 
a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf 
b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
index d8c938e..c549a8d 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
@@ -271,7 +271,7 @@ run() {
         fi
 
         if [ "${ROOT_INSTANCE_RUNNING}" = "false" ] || [ 
"${CHECK_ROOT_INSTANCE_RUNNING}" = "false" ] ; then
-            if [ "${VERSION}" -gt "80" ]; then
+            if [ "${VERSION}" -gt "8" ]; then
                 ${KARAF_EXEC} "${JAVA}" ${JAVA_OPTS} \
                     --add-opens java.base/java.security=ALL-UNNAMED \
                     --add-opens java.base/java.net=ALL-UNNAMED \

-- 
To stop receiving notification emails like this one, please contact
gno...@apache.org.

Reply via email to