You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/16 07:32:25 UTC

[GitHub] [maven-mvnd] gzm55 commented on a diff in pull request #716: calculate java home from java command

gzm55 commented on code in PR #716:
URL: https://github.com/apache/maven-mvnd/pull/716#discussion_r996402720


##########
common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java:
##########
@@ -101,6 +102,29 @@ public static long findProcessRssInKb(long pid) {
         }
     }
 
+    public static String findJavaHomeFromPATH() {
+        final String basename = Os.current().isUnixLike() ? "java" : "java.exe";
+        final String PATH = System.getenv("PATH");
+        if (null == PATH) {
+            return null;
+        }
+        for (final String dirname : PATH.split(File.pathSeparator)) {

Review Comment:
   In the latest commit, the env PATH is not parsed, and the `java` is auto searched by `ProcessBuilder`.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org