Tomcat and OpenJDK.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Tomcat and OpenJDK.

Postby SystemL » 30. September 2019 19:47

hi, my name luis born italy my english elementary .. my test start tomcat .. my problem not working launch from openjdk windows.

My screenshot:
Image
Image

How to solution ?
Last edited by SystemL on 30. September 2019 20:01, edited 1 time in total.
SystemL
 
Posts: 11
Joined: 23. November 2016 16:43
XAMPP version: 3.2.2
Operating System: Windows 10 64 bit

Re: Tomcat and OpenJDK.

Postby SystemL » 30. September 2019 19:54

my test version.bat:
Code: Select all
D:\xampp\tomcat\bin>version.bat
Using CATALINA_BASE:   "D:\xampp\tomcat"
Using CATALINA_HOME:   "D:\xampp\tomcat"
Using CATALINA_TMPDIR: "D:\xampp\tomcat\temp"
Using JRE_HOME:        "C:\Program Files\AdoptOpenJDK\jre-11.0.4.11-hotspot"
Using CLASSPATH:       "D:\xampp\tomcat\bin\bootstrap.jar;D:\xampp\tomcat\bin\tomcat-juli.jar"
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Server version: Apache Tomcat/7.0.92
Server built:   Nov 9 2018 11:07:44 UTC
Server number:  7.0.92.0
OS Name:        Windows 10
OS Version:     10.0
Architecture:   amd64
JVM Version:    11.0.4+11
JVM Vendor:     AdoptOpenJDK
D:\xampp\tomcat\bin>
SystemL
 
Posts: 11
Joined: 23. November 2016 16:43
XAMPP version: 3.2.2
Operating System: Windows 10 64 bit

Re: Tomcat and OpenJDK.

Postby SystemL » 30. September 2019 20:02

Image

how to start in cmd.exe in folder d:\xampp\tomcat\bin\catalina.bat start


Code: Select all
D:\xampp\tomcat\bin>catalina.bat start
Using CATALINA_BASE:   "D:\xampp\tomcat"
Using CATALINA_HOME:   "D:\xampp\tomcat"
Using CATALINA_TMPDIR: "D:\xampp\tomcat\temp"
Using JRE_HOME:        "C:\Program Files\AdoptOpenJDK\jre-11.0.4.11-hotspot"
Using CLASSPATH:       "D:\xampp\tomcat\bin\bootstrap.jar;D:\xampp\tomcat\bin\tomcat-juli.jar"

D:\xampp\tomcat\bin>

with panel control???
SystemL
 
Posts: 11
Joined: 23. November 2016 16:43
XAMPP version: 3.2.2
Operating System: Windows 10 64 bit

Re: Tomcat and OpenJDK.

Postby jnickel » 13. October 2019 23:17

Hi Luis,

I came across the same problem when I tried to run Tomcat with version 11 of the JRE from AdoptOpenJDK.

There are essentially two problems that occur during the Catalina start sequence:
1) The script c:\xampp\catalina_start.bat is looking in certain places of the Registry to determine the installation location of the JRE. However, the keys for the newer JREs are a bit different than the ones used by earlier versions.
2) The script c:\xampp\tomcat\bin\catalina.bat is starting tomcat with the option -Djava.endorsed.dirs which is deprecated and causes the JVM to fail the start-up.

I have cooked up a quick hack this morning to solve my problem. These to changes might help you, but there not quite production ready.
In c:\xampp\catalina_start.bat, you need to apply the following diff:
Code: Select all
--- /cygdrive/d/xampp/catalina_start.bat   2013-06-07 13:15:48.000000000 +0200
+++ /cygdrive/c/xampp/catalina_start.bat   2019-10-13 08:36:09.923539900 +0200
@@ -19,6 +19,7 @@
 set JDKKeyName64=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
 set JDKKeyName32=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit
 set JREKeyName64=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
+set JREKeyName64Short=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE
 set JREKeyName32=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment
 
 reg query "%JDKKeyName64%" /s
@@ -43,7 +44,17 @@
 :FINDJRE64
 reg query "%JREKeyName64%" /s
 if %ERRORLEVEL% EQU 1 (
-   echo . [XAMPP]: Could not find 32 bit or 64 bit JRE
+   echo . [XAMPP]: Could not find 32 bit or 64 bit JRE with long name
+   echo . [XAMPP]: Looking for 32 bit or 64 bit JRE on 64 bit machine with short name
+   goto FINDJRE64SHORT
+)
+set KeyName=%JREKeyName64%
+goto JRERUN
+
+:FINDJRE64SHORT
+reg query "%JREKeyName64Short%" /s
+if %ERRORLEVEL% EQU 1 (
+   echo . [XAMPP]: Could not find 32 bit or 64 bit JRE with short name
    echo . [XAMPP]: Looking for 32 bit JRE on 64 bit machine
    goto FINDJRE32
 )


You might also have to set $JAVA_HOME in order to bypass other tests. In addition, you should use the latest XAMPP which have a c:\xampp\tomcat\bin\catalina.bat that considers the changes to the endorsed dirs in Java 9 and later.

I hope this helps to get you started.

Regards,

Jonas
jnickel
 
Posts: 1
Joined: 13. October 2019 21:26
XAMPP version: 3.2.2
Operating System: Windows 10

Re: Tomcat and OpenJDK.

Postby gonzalo » 24. October 2019 08:52

Hi,

Thanks for reporting this issue and for posting here a solution. We have been working on adding the checks for this registry entry and others for the JDK version and we plan to release a new revision of our installers soon.

Regards,
Gonzalo
gonzalo
 
Posts: 19
Joined: 12. March 2019 08:52
XAMPP version: any
Operating System: any

Re: Tomcat and OpenJDK.

Postby gonzalo » 24. October 2019 11:37

Hi,

We released a new revision of the XAMPP products adding support for AdoptOpenJDK on Windows platforms. The installers adding this new features are 7.1.32-2, 7.2.23-1 and 7.3.10-1.
gonzalo
 
Posts: 19
Joined: 12. March 2019 08:52
XAMPP version: any
Operating System: any


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 65 guests