Matrix42 commented on a change in pull request #8011: [FLINK-11958][on-yarn]
fix flink on windows yarn deploy failed
URL: https://github.com/apache/flink/pull/8011#discussion_r267170561
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java
##########
@@ -1555,7 +1555,15 @@ protected ContainerLaunchContext
setupApplicationMasterContainer(
ContainerLaunchContext amContainer =
Records.newRecord(ContainerLaunchContext.class);
final Map<String, String> startCommandValues = new HashMap<>();
- startCommandValues.put("java", "$JAVA_HOME/bin/java");
+ String osName = System.getProperty("os.name");
+ String javaHome;
+ if (osName.startsWith("Windows")) {
+ javaHome = "%JAVA_HOME%";
+ } else {
+ javaHome = "$JAVA_HOME";
+ }
+ String javaCommand = javaHome + "/bin/java";
Review comment:
It's legal use `/` on Windows
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services