Bug 864252 - JON server fails to find JVM if JAVA_HOME path contains spaces
Summary: JON server fails to find JVM if JAVA_HOME path contains spaces
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Core Server
Version: JON 3.0.0
Hardware: All
OS: Windows
unspecified
high
Target Milestone: ---
: JON 3.2.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 769604
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-09 01:31 UTC by Larry O'Leary
Modified: 2018-11-26 18:05 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 769604
Environment:
Last Closed: 2013-05-24 19:37:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 67798 0 None None None 2012-10-09 01:31:06 UTC

Description Larry O'Leary 2012-10-09 01:31:05 UTC
+++ This bug was initially created as a clone of RHQ Bug #769604 +++

Description of problem:
If the Windows JAVA_HOME Environment Variable or the RHQ_SERVER_JAVA_HOME variable contains spaces in the path it will fail to find the jvm.

Version-Release number of selected component (if applicable):
3.0

How reproducible:
Always

Steps to Reproduce:
1.Install JAVA on a windows box to a directory containing spaces
2.Either set the Windows JAVA_HOME Environment variable or edit the rhq-server.bat file to set the RHQ_SERVER_JAVA_HOME to the above installed JAVA
3.Run rhq-server.bat
  
Actual results:
Server does not start with Error can't find jvm

Expected results:
JON Server starts.

--- Additional comment from dsteigne on 2011-12-21 07:56:58 EST ---

Workaround is to use the Windows short name, C:\Progra~1\java\jdk1.6.0_30.

Comment 1 John Mazzitelli 2013-05-24 16:00:41 UTC
I need to know *exactly* what you set JAVA_HOME to.

I just tried it and the rhq-server.bat worked BUT! only if I did not wrap my env var value in quotes.

Things WORKED when I used this command line to set my JAVA_HOME:

set JAVA_HOME=C:\Program Files\Java\jre7

If I echoed %JAVA_HOME% I saw this:

> echo %JAVA_HOME%
C:\Program Files\Java\jre7

Notice there are NO quotes in the value.

However, things FAILED to work when I did this:

set JAVA_HOME="C:\Program Files\Java\jre7"

> echo %JAVA_HOME%
"C:\Program Files\Java\jre7"

When I ran "rhq-server.bat status", I got this error message:

There is no JVM available.
Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH appropriately.

Turn on debug and see what your script says. So do this:

set RHQ_SERVER_DEBUG=true

and then run rhq-server.bat again. You should see what values it wants to use. When using quotes in the JAVA_HOME value, you'll see something like this (which is wrong):

RHQ_SERVER_JAVA_EXE_FILE_PATH: "C:\Program Files\Java\jre7"\bin\java.exe

The quotes appear to be messed up.

So, in short, when you define JAVA_HOME, do NOT wrap the value in quotes.

I'm putting this with a NEEDINFO to the reporter to confirm this work. If it does, we should close this as NOTABUG.

Comment 2 Larry O'Leary 2013-05-24 19:37:33 UTC
You are correct. In the original case that raised this issue, JAVA_HOME was set as follows:

    set JAVA_HOME="C:\Program Files (x86)\Java\jdk1.6.0_30"

I have updated the knowledge information and am marking this as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.