Java 9 vs service installations

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

Java 9 vs service installations

Postby vgriffin » 20. December 2017 05:34

I can't get XAMPP to install Tomcat as a service. This is really something I noticed on 7.1.8, but the code problem seems to be in 7.1.12 as well.

If I tell XAMPP that I want Tomcat to run as a service, and, then, click Start, the integrated log displays:

Attempting to start Tomcat service...
Executing "net start "Tomcat7""
Return code 0

But it's not started. The commons-daemon.log for the current time includes:

[2017-12-19 14:04:52] [info] [68680] Commons Daemon procrun (1.0.15.0 32-bit) started
[2017-12-19 14:04:53] [info] [68680] Running 'Tomcat7' Service...
[2017-12-19 14:04:53] [info] [68728] Starting service...
[2017-12-19 14:04:53] [error] [68728] %1 is not a valid Win32 application.
[2017-12-19 14:04:53] [error] [68728] Failed creating java C:\Program Files\Java\jdk1.8.0_66\jre\bin\server\jvm.dll
[2017-12-19 14:04:53] [error] [68728] %1 is not a valid Win32 application.
[2017-12-19 14:04:53] [error] [68728] ServiceStart returned 1
[2017-12-19 14:04:53] [error] [68728] %1 is not a valid Win32 application.
[2017-12-19 14:04:53] [info] [68680] Run service finished.
[2017-12-19 14:04:53] [info] [68680] Commons Daemon procrun finished

I'm running Java 9, which I loaded as soon as it was in general release and have upgraded to Java 9.0.1.

The problem is in catalina_service.bat (and other files which include JavaHome). It includes the code:

echo [XAMPP]: Searching for JDK or JRE HOME with reg query ...
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 JREKeyName32=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

If one of those is found, it sets and uses JAVA_HOME, ignoring the VALID setting of JAVA_HOME in my settings.

The latest setting I have that fits the search criteria is 1.8 u66, which is no longer on my system. The test does not find ANY Java 9 version as the Windows Registry now includes

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK or HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE

Therefore, it can't find Java and generates the error.

The workaround is to manually tell Windows about the server.
vgriffin
 
Posts: 8
Joined: 20. December 2017 04:53
XAMPP version: 7.1.12
Operating System: Windows 10

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 107 guests