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

kevin su commented on HADOOP-16351:
-----------------------------------

Sorry for the late reply, I just set up my Windows env for Hadoop.  

if we don't use _*ApplicationConstants.CLASS_PATH_SEPARATOR,*_ the path will be 
%PATH%:%JAVA_CLASSPATH%  on Windows

Windows use ";" instead of ":" to separate classpath
{code:java}
StringBuilder classPathEnv = new StringBuilder(Environment.CLASSPATH.$$())
 .append(ApplicationConstants.CLASS_PATH_SEPARATOR).append("./*");
 for (String c : conf.getStrings(
 YarnConfiguration.YARN_APPLICATION_CLASSPATH,
 YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) {
 classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR)
 .append(c.trim());
 }
 classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append(
 "./log4j.properties");

// add the runtime classpath needed for tests to work
 if (conf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) {
 classPathEnv.append(':')
 .append(System.getProperty("java.class.path"));
 }

env.put("CLASSPATH", classPathEnv.toString());
{code}
Above code shows that how classpath was be built for ApplicationMaster

> Change ":" to ApplicationConstants.CLASS_PATH_SEPARATOR
> -------------------------------------------------------
>
>                 Key: HADOOP-16351
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16351
>             Project: Hadoop Common
>          Issue Type: Task
>          Components: common
>    Affects Versions: 3.1.2
>            Reporter: kevin su
>            Assignee: kevin su
>            Priority: Trivial
>             Fix For: 3.1.2
>
>         Attachments: HADOOP-16351.01.patch
>
>
> under distributedshell/Clients.java 
> We should change ":" to ApplicationConstants.CLASS_PATH_SEPARATOR, so it 
> could also support Windows client
> {code}
> // add the runtime classpath needed for tests to work
>     if (conf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) {
>       classPathEnv.append(':')
>           .append(System.getProperty("java.class.path"));
>     }
> {code}
> {code}
> // add the runtime classpath needed for tests to work
>     if (conf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) {
>       classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR)
>           .append(System.getProperty("java.class.path"));
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to