[ 
https://issues.apache.org/jira/browse/HADOOP-9600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13668836#comment-13668836
 ] 

Chuan Liu commented on HADOOP-9600:
-----------------------------------

Have you tried to add quotes as part of the %JAVA% and %CLASSPATH% environment 
variables?
So we don't need to quote them in the for command. The 'for' statement becomes 
something like the follows.
{noformat}
for /f "delims=" %%A in ("%JAVA_QUOTED% -Xmx32m %HADOOP_JAVA_PLATFORM_OPTS% 
-classpath %CLASSPATH_QUOTED% org.apache.hadoop.util.PlatformName") do set 
JAVA_PLATFORM=%%A
{noformat}
where JAVA_QUOTED="C:\Program Files\Java\jdk1.7.0_11\bin\java.exe", and 
CLASSPATH_QUOTED="<all classpath>".

Another option may be usebackq.
I am not sure if it will work; but I think it worth trying.
                
> In Windows: Hadoop fails to run when JAVA_HOME has spaces in it
> ---------------------------------------------------------------
>
>                 Key: HADOOP-9600
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9600
>             Project: Hadoop Common
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Mostafa Elhemali
>            Assignee: Mostafa Elhemali
>         Attachments: HADOOP-9600.2.patch, HADOOP-9600.3.patch, 
> HADOOP-9600.patch
>
>
> hadoop-config.cmd misbehaves when JAVA_HOME has spaces in it (e.g. if Java is 
> in c:\Program Files).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to