Bug 574005

Summary: CLI fails to start with spaces in JAVA_HOME variable
Product: [Other] RHQ Project Reporter: Simeon Pinder <spinder>
Component: CLIAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.3.1CC: ccrouch, hrupp, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.9   
Hardware: All   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-09 14:28:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 574133    

Description Simeon Pinder 2010-03-16 12:10:15 UTC
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 15:57:26 UTC
Jay, you as Win user, could you please quickly check if that is still an issue?

Comment 2 Jay Shaughnessy 2013-12-09 14:28:17 UTC
This works fine and probably has for a while.  I'm closing.