Myasuka 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_r266996464
##########
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:
You could use java's `File.separator` to combine the `javaCommand` instead
of just use hard code `/` if really wants to run 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