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: 42
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: 42
Joined: 12. March 2019 08:52
XAMPP version: any
Operating System: any

Re: Tomcat and OpenJDK.

Postby jvisions » 18. December 2019 12:56

Hi,

I am completely new in this forum but using XAMPP as my first test and development environment since... damn I'm getting old. :D

As a small note to the catalina_start.bat:
The script requires at least one of the keys in the windows registry.
My problem is, that it does not check for existing environment variables. If the registry entries are not defined, the script does not start tomcat, even if JAVA_HOME or JRE_HOME are already set.

Thus my small rework for the catalina_start.bat in the xampp directory:

I have modified the section FINDJRE32 not to go to ENDERROR and added two new section to take care of existing environment variables:
Code: Select all
:FINDJRE32
reg query "%JREKeyName32%" /s
if %ERRORLEVEL% EQU 1 (
    echo . [XAMPP]: Could not find 32 bit JRE
    echo . [XAMPP]: Could not set JAVA_HOME or JRE_HOME. Looking for existing environment variables
    goto FINDJDKENV
)
set KeyName=%JREKeyName32%
goto JRERUN

:FINDJDKENV
if NOT DEFINED JAVA_HOME (
   echo . [XAMPP]: Could not find environment variable JAVA_HOME
   echo . [XAMPP]: Looking environment variable JRE_HOME
   goto FINDJREENV
)
goto JDKRUN

:FINDJREENV
if NOT DEFINED JRE_HOME (
   echo . [XAMPP]: Could not find environment variable JRE_HOME
   echo . [XAMPP]: Could not verify java location by reg query or environment variables
   goto ENDERROR
)
goto JRERUN


IMHO the environment variables should checked first instead of querying the registry.
Because first, the installers of Java might have already set the environment variables, second it is more handy on a system with multiple Java installations, third most of the documentations and advices are about the environment variables.
But this would be a matter of taste if not even philosophical.

Greetings
Stefan
jvisions
 
Posts: 1
Joined: 18. December 2019 12:07
XAMPP version: 7.3.12
Operating System: Windows

Re: Tomcat and OpenJDK.

Postby Cazeh » 04. February 2020 16:52

Still having this problem sadly...
https://prnt.sc/qxgpwu

Tried using the jvisions posted. Doenst work for me sadly...
Cazeh
 
Posts: 1
Joined: 04. February 2020 16:32
XAMPP version: 3.2.4
Operating System: Windows 10

Re: Tomcat and OpenJDK.

Postby gonzalo » 06. February 2020 17:17

Hi Cazeh,

Can you tell us which version of PHP are you using? Which installer? i.e. `7.4.1-0`, `7.2.21-2`, etc.

Also, which JAVA distribution name and version? I mean, is it AdoptOpenJDK version `jdk8u242-b08` or any other JAVA distribution and version? Do you have the link to download it? Do you know the registry entries it added if any? Please give us as much information as possible so we can try to reproduce your issue.
gonzalo
 
Posts: 42
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 138 guests