offthewall123 commented on a change in pull request #30831:
URL: https://github.com/apache/spark/pull/30831#discussion_r546377679
##########
File path:
launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java
##########
@@ -92,18 +92,11 @@
List<String> buildJavaCommand(String extraClassPath) throws IOException {
List<String> cmd = new ArrayList<>();
- String[] candidateJavaHomes = new String[] {
- javaHome,
+ String firstJavaHome = firstNonEmpty(javaHome,
childEnv.get("JAVA_HOME"),
System.getenv("JAVA_HOME"),
- System.getProperty("java.home")
- };
- for (String javaHome : candidateJavaHomes) {
- if (javaHome != null) {
- cmd.add(join(File.separator, javaHome, "bin", "java"));
- break;
- }
- }
+ System.getProperty("java.home"));
+ cmd.add(join(File.separator, firstJavaHome, "bin", "java"));
Review comment:
Actually it will be dealed in `join`.....Anyway, have added this, thanks
for review.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]