You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/05/20 22:12:50 UTC

[Bug 62391] New: Unable to Install Windows Service with Server JRE

https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

            Bug ID: 62391
           Summary: Unable to Install Windows Service with Server JRE
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Packaging
          Assignee: dev@tomcat.apache.org
          Reporter: dev@21solutions.net
  Target Milestone: ----

When attempting to install Tomcat as a Windows service, bin/service.bat checks
for the existence of java.exe and javaw.exe in the JRE's bin directory and
fails if either does not exist.

java.exe exists on all of the Java distributions for Windows, but javaw.exe
exists only on distributions that utilize GUI.

The Server JRE, which is the recommended distribution for server deployments
does not include javaw.exe, and therefore the service installation from
service.bat fails.

I checked with both Java 1.8u171 and Java 10.0.1:

$ ls -al server-jre\jdk1.8.0_171\bin\ | grep java
-rwxr-xr-x 1 Admin None  16808 Mar 28 17:15 java-rmi.exe
-rwxr-xr-x 1 Admin None 207784 Mar 28 17:15 java.exe
-rwxr-xr-x 1 Admin None  16808 Mar 28 17:15 javac.exe

$ ls -al server-jre\jdk-10.0.1\bin\ | grep java
-rwxr-xr-x 1 Admin None  150448 Mar 26 19:02 java.dll
-rwxr-xr-x 1 Admin None  232368 Mar 26 19:02 java.exe
-rwxr-xr-x 1 Admin None   17840 Mar 26 19:02 javac.exe
-rwxr-xr-x 1 Admin None  166320 Mar 26 19:02 javajpeg.dll

The fix is very easy.  The line

    if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome

at https://github.com/apache/tomcat/blob/trunk/bin/service.bat#L55 should be
removed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Take a look at the svn history. As far as I can tell, javaw.exe has never been
used.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

--- Comment #2 from Christopher Schultz <ch...@christopherschultz.net> ---
IIRC, java.exe will always open a command-prompt to run the command. That's why
javaw.exe exists.

For a "server install", does that mean that a console needs to be available
because java.exe will run instead of javaw.exe?

Windows Service probably works regardless.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
The proposed change makes sense to me. A couple of questions come to mind:
1. Why was the script written to check for both files? Is there any explanation
in the svn history?
2. Does the Windows installer have a similar problem?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

--- Comment #5 from Igal Sapir <de...@21solutions.net> ---
(In reply to Mark Thomas from comment #1)
> <snip/>
> 2. Does the Windows installer have a similar problem?

I just ran the Windows Service Installer executable of Tomcat 9.0.8 on Windows
10 and pointed it to the Server JRE which does not have the `javaw.exe` file.

The installation completed with no errors and the service started successfully,
so this issue does not affect the Windows Service Installer.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

--- Comment #4 from Igal Sapir <de...@21solutions.net> ---
> IIRC, java.exe will always open a command-prompt to run the command. That's why javaw.exe exists.

Right, but that is for Windowed, GUI applications where you don't want a
console window to open with the application.  I believe that that's where the
`w` comes from in `javaw`.

> Take a look at the svn history. As far as I can tell, javaw.exe has never been used.

I have been using Tomcat with the Server JRE on Windows for a few years now. 
The Windows service runs well with the `java.exe` only.  

The only problem is with the installation of the Windows Service via
`service.bat`.

If there is no objection then I will go ahead and remove the offensive line.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62391] Unable to Install Windows Service with Server JRE

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62391

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- trunk for 9.0.9 onwards
- 8.5.x for 8.5.32 onwards
- 8.0.x for 8.0.53 onwards
- 7.0.x for 7.0.89 onwards

I removed all references to javaw.exe from the scripts. I also checked for
references anywhere else in the source code. There were none.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org