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

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

Thanks for the patch!

Why we need the following change?

{noformat}
-for /f "delims=" %%A in ('%JAVA% -Xmx32m %HADOOP_JAVA_PLATFORM_OPTS% 
-classpath "%CLASSPATH%" org.apache.hadoop.util.PlatformName') do set 
JAVA_PLATFORM=%%A
+%JAVA% -Xmx32m %HADOOP_JAVA_PLATFORM_OPTS% -classpath "%CLASSPATH%" 
org.apache.hadoop.util.PlatformName > %TEMP%\java_platforms.txt
+set /p JAVA_PLATFORM=<%TEMP%\java_platforms.txt
+del %TEMP%\java_platforms.txt
 @rem replace space with underscore
 set JAVA_PLATFORM=%JAVA_PLATFORM: =_%
{noformat}
                
> 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