tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject tomee git commit: Detect java version and act on it. After java 11: - Remove jre references because they are invalid when using the JDK. - Remove endorced property def. because is no longer supported.
Date Wed, 24 Oct 2018 12:24:29 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-7.0.x 6709b3d9a -> 4309ec73f


Detect java version and act on it. After java 11: - Remove jre references because they are
invalid when using the JDK. - Remove endorced property def. because is no longer supported.

Signed-off-by: brunobat <brunobat@gmail.com>


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

Branch: refs/heads/tomee-7.0.x
Commit: 4309ec73f2c452fed5ca96dee6d344247dbee27b
Parents: 6709b3d
Author: brunobat <brunobat@gmail.com>
Authored: Tue Oct 23 12:14:22 2018 +0100
Committer: brunobat <brunobat@gmail.com>
Committed: Tue Oct 23 12:14:22 2018 +0100

----------------------------------------------------------------------
 .../apache-tomee/src/main/resources/service.bat | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/4309ec73/tomee/apache-tomee/src/main/resources/service.bat
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/resources/service.bat b/tomee/apache-tomee/src/main/resources/service.bat
index 900526b..3483e98 100644
--- a/tomee/apache-tomee/src/main/resources/service.bat
+++ b/tomee/apache-tomee/src/main/resources/service.bat
@@ -90,11 +90,18 @@ if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
 if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
 goto okJavaHome
 :gotJdkHome
-if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
-if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
+for /f tokens^=2-5^ delims^=.-_^" %%j in ('%JAVA_HOME%\bin\java.exe -fullversion 2^>^&1')
do set "JAVA_MAJOR_VERSION=%%j"
+if JAVA_MAJOR_VERSION lss 11 (
+    if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
+    if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
+)
 if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
 if not "%JRE_HOME%" == "" goto okJavaHome
-set "JRE_HOME=%JAVA_HOME%\jre"
+if %JAVA_MAJOR_VERSION% lss 11 (
+    set "JRE_HOME=%JAVA_HOME%\jre"
+) else (
+    set "JRE_HOME=%JAVA_HOME%"
+)
 goto okJavaHome
 :noJavaHome
 echo The JAVA_HOME environment variable is not defined correctly
@@ -190,9 +197,9 @@ echo Using JVM:              "%PR_JVM%"
     --StopMode jvm ^
     --LogLevel Info ^
     --LogPrefix TomEE
-    
+
 echo Installed, will now configure TomEE
-    
+
 if not errorlevel 1 goto installed
 echo Failed installing '%SERVICE_NAME%' service
 goto end
@@ -207,8 +214,13 @@ set PR_CLASSPATH=
 set PR_JVM=
 
 rem Set extra parameters
-"%EXECUTABLE%" //US//%SERVICE_NAME% ^
-	++JvmOptions "-javaagent:%CATALINA_HOME%\lib\openejb-javaagent.jar;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed"
+if %JAVA_MAJOR_VERSION% lss 11 (
+    "%EXECUTABLE%" //US//%SERVICE_NAME% ^
+    	++JvmOptions "-javaagent:%CATALINA_HOME%\lib\openejb-javaagent.jar;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed"
+) else (
+    "%EXECUTABLE%" //US//%SERVICE_NAME% ^
+	    ++JvmOptions "-javaagent:%CATALINA_HOME%\lib\openejb-javaagent.jar;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%"
+)
 
 rem More extra parameters
 set "PR_LOGPATH=%CATALINA_BASE%\logs"


Mime
View raw message