karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [karaf] 01/01: [KARAF-5696 [KARAF-5696] Fix version detection on windows
Date Wed, 11 Apr 2018 09:15:11 GMT
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

commit eaae22a5d399b48b81ac0f7de1c803be42063b5b
Author: Guillaume Nodet <gnodet@gmail.com>
AuthorDate: Wed Apr 11 11:10:54 2018 +0200

    [KARAF-5696
    [KARAF-5696] Fix version detection on windows
---
 .../base/src/main/filtered-resources/resources/bin/karaf.bat      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
index b18b46c..d87b929 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
@@ -214,6 +214,11 @@ if not "%JAVA%" == "" goto :Check_JAVA_END
     set JAVA=%JAVA_HOME%\bin\java
 :Check_JAVA_END
 
+rem Retrieve java version
+for /f tokens^=2-5^ delims^=.-_+^" %%j in ('"%JAVA%" -fullversion 2^>^&1') do (
+    if %%j==1 (set JAVA_VERSION=%%k) else (set JAVA_VERSION=%%j)
+)
+
 :CheckRootInstance
     set ROOT_INSTANCE_RUNNING=false
     if exist "%KARAF_HOME%\instances\instance.properties" (
@@ -395,10 +400,9 @@ if "%KARAF_PROFILER%" == "" goto :RUN
     if "%ROOT_INSTANCE_RUNNING%" == "false" SET IS_RUNNABLE=true
     if "%CHECK_ROOT_INSTANCE_RUNNING%" == "false" SET IS_RUNNABLE=true
     if "%IS_RUNNABLE%" == "true" (
-        for /f tokens^=2-5^ delims^=.-_^" %%j in ('"%JAVA%" -fullversion 2^>^&1')
do set "JAVA_VERSION=%%j%"
         rem If major version is greater than 1 (meaning Java 9 or 10), we don't use endorsed
lib but module
         rem If major version is 1 (meaning Java 1.6, 1.7, 1.8), we use endorsed lib
-        if "%JAVA_VERSION%" GTR 1 (
+        if %JAVA_VERSION% GTR 8 (
             "%JAVA%" %JAVA_OPTS% %OPTS% ^
                 --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,java.xml.ws,ALL-UNNAMED
^
                 --patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-@@project.version@@.jar
^

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

Mime
View raw message