Bug 574005 - CLI fails to start with spaces in JAVA_HOME variable
CLI fails to start with spaces in JAVA_HOME variable
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
1.3.1
All Windows
medium Severity medium (vote)
: ---
: RHQ 4.9
Assigned To: John Sanda
Mike Foley
:
Depends On:
Blocks: 574133
  Show dependency treegraph
 
Reported: 2010-03-16 08:10 EDT by Simeon Pinder
Modified: 2013-12-09 09:28 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-09 09:28:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Simeon Pinder 2010-03-16 08:10:15 EDT
Description of problem: the rhq-cli.bat script does not handle spaces in the JAVA_HOME directory properly.  CLI works when %JAVA_HOME% and %PATH% variables are set and do not have spaces in them.  Setting the suggested JAVA* variables suggested by the shell do not solve the problem either.


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

How reproducible:
On windows, repeat the steps below.

Steps to Reproduce:
1) Verify that CLI works when no spaces are in the path
C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %JAVA_HOME%
C:\jdk1.6.0_05

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %PATH%
C:\jdk1.6.0_05\bin;C:\Program Files\OpenSSH\bin;

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>bin\rhq-cli.bat
RHQ - RHQ Enterprise Remote CLI 1.3.1.GA
unconnected$ quit

2) Reset JAVA_HOME to a directory with spaces in the path and PATH evironment variable to value with new JAVA_HOME.
C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>set JAVA_HOME="C:\temp\java dir\jdk1.6.0
_05"

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>set PATH=%JAVA_HOME%\bin;%PATH%

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %JAVA_HOME%
"C:\temp\java dir\jdk1.6.0_05"

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %JAVA_HOME%
"C:\temp\java dir\jdk1.6.0_05"

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %PATH%
"C:\temp\java dir\jdk1.6.0_05"\bin

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>%JAVA_HOME%\bin\java.exe -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)

3) Run cli script.
C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>bin\rhq-cli.bat
 Volume in drive C has no label.
 Volume Serial Number is 147C-09D9

 Directory of C:\jdk1.6.0_05\bin

02/22/2008  03:12 AM           135,168 java.exe
               1 File(s)        135,168 bytes

 Directory of C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA

File Not Found
There is no JVM available.
Please set RHQ_CLI_JAVA_HOME or RHQ_CLI_JAVA_EXE_FILE_PATH appropriately.

4) Follow script instructions and set RHQ_CLI_JAVA_HOME and RHQ_CLI_JAVA_EXE_FILE_PATH variables and test.
C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>set RHQ_CLI_JAVA_HOME=%JAVA_HOME%

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>bin\rhq-cli.bat
 Volume in drive C has no label.
 Volume Serial Number is 147C-09D9

 Directory of C:\jdk1.6.0_05\bin

02/22/2008  03:12 AM           135,168 java.exe
               1 File(s)        135,168 bytes

 Directory of C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA

File Not Found
There is no JVM available.
Please set RHQ_CLI_JAVA_HOME or RHQ_CLI_JAVA_EXE_FILE_PATH appropriately.

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>set RHQ_CLI_JAVA_EXE_FILE_PATH=%JAVA_HOME%\bin\java.exe

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>bin\rhq-cli.bat
 Volume in drive C has no label.
 Volume Serial Number is 147C-09D9

 Directory of C:\jdk1.6.0_05\bin

02/22/2008  03:12 AM           135,168 java.exe
               1 File(s)        135,168 bytes

 Directory of C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA

File Not Found
There is no JVM available.
Please set RHQ_CLI_JAVA_HOME or RHQ_CLI_JAVA_EXE_FILE_PATH appropriately.


C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %JAVA_HOME%
"C:\temp\java dir\jdk1.6.0_05"

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %RHQ_CLI_JAVA_HOME%
"C:\temp\java dir\jdk1.6.0_05"

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>echo %RHQ_CLI_JAVA_EXE_FILE_PATH%
"c:\temp\java dir\jdk1.6.0_05\bin\java.exe"
  
Actual results:

File Not Found
There is no JVM available.
Please set RHQ_CLI_JAVA_HOME or RHQ_CLI_JAVA_EXE_FILE_PATH appropriately.

Expected results:

C:\installers\JON\2.3.1\rhq-remoting-cli-1.3.1.GA>bin\rhq-cli.bat
RHQ - RHQ Enterprise Remote CLI 1.3.1.GA
unconnected$ quit

Additional info:
Comment 1 Heiko W. Rupp 2013-12-07 10:57:26 EST
Jay, you as Win user, could you please quickly check if that is still an issue?
Comment 2 Jay Shaughnessy 2013-12-09 09:28:17 EST
This works fine and probably has for a while.  I'm closing.

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