karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-4985] Add test on Java version on karaf.bat to use the correct startup command
Date Thu, 03 Aug 2017 15:07:06 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 71323669d -> b563c712c


[KARAF-4985] Add test on Java version on karaf.bat to use the correct startup command


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/b563c712
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/b563c712
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/b563c712

Branch: refs/heads/master
Commit: b563c712ca95c8054b19817da05849c72f0a922a
Parents: 7132366
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Thu Aug 3 15:35:11 2017 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Thu Aug 3 17:06:49 2017 +0200

----------------------------------------------------------------------
 .../filtered-resources/resources/bin/karaf.bat  | 52 +++++++++++++++-----
 1 file changed, 39 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/b563c712/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
----------------------------------------------------------------------
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 7ca6a0e..affeaf4 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
@@ -387,19 +387,45 @@ 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" (
-    "%JAVA%" %JAVA_OPTS% %OPTS% ^
-        -classpath "%CLASSPATH%" ^
-        -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed"
^
-        -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext"
^
-        -Dkaraf.instances="%KARAF_HOME%\instances" ^
-        -Dkaraf.home="%KARAF_HOME%" ^
-        -Dkaraf.base="%KARAF_BASE%" ^
-        -Dkaraf.etc="%KARAF_ETC%" ^
-        -Dkaraf.restart.jvm.supported=true ^
-        -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-        -Dkaraf.data="%KARAF_DATA%" ^
-        -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^
-        %KARAF_OPTS% %MAIN% %ARGS%
+        for /f tokens^=2-5^ delims^=.-_^" %%j in ('%JAVA% -fullversion 2^>^&1') do
set "JAVA_VERSION=%%k%"
+        if "%JAVA_VERSION%" GTR 8 (
+            "%JAVA%" %JAVA_OPTS% %OPTS% ^
+                --add-opens java.base/java.security=ALL-UNNAMED ^
+                --add-opens java.base/java.net=ALL-UNNAMED ^
+                --add-opens java.base/java.lang=ALL-UNNAMED ^
+                --add-opens java.base/java.util=ALL-UNNAMED ^
+                --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED ^
+                --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED ^
+                --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED ^
+                --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED
^
+                --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED ^
+                --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED ^
+                --add-modules java.xml.ws.annotation,java.corba,java.transaction,java.xml.bind,java.xml.ws
^
+                -classpath "%CLASSPATH%" ^
+                -Dkaraf.instances="%KARAF_HOME%\instances" ^
+                -Dkaraf.home="%KARAF_HOME%" ^
+                -Dkaraf.base="%KARAF_BASE%" ^
+                -Dkaraf.etc="%KARAF_ETC%" ^
+                -Dkaraf.restart.jvm.supported=true ^
+                -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
+                -Dkaraf.data="%KARAF_DATA%" ^
+                -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties"
^
+                %KARAF_OPTS% %MAIN% %ARGS%
+        ) else (
+            "%JAVA%" %JAVA_OPTS% %OPTS% ^
+                -classpath "%CLASSPATH%" ^
+                -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed"
^
+                -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext"
^
+                -Dkaraf.instances="%KARAF_HOME%\instances" ^
+                -Dkaraf.home="%KARAF_HOME%" ^
+                -Dkaraf.base="%KARAF_BASE%" ^
+                -Dkaraf.etc="%KARAF_ETC%" ^
+                -Dkaraf.restart.jvm.supported=true ^
+                -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
+                -Dkaraf.data="%KARAF_DATA%" ^
+                -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties"
^
+                %KARAF_OPTS% %MAIN% %ARGS%
+        )
     ) else (
         echo There is a Root instance already running with name %ROOT_INSTANCE_NAME% and
pid %ROOT_INSTANCE_PID%. If you know what you are doing and want to force the run anyway,
SET CHECK_ROOT_INSTANCE_RUNNING=false and re run the command.
         goto :END


Mime
View raw message