pono closed pull request #117: [MNG-5756] Java home output in mvn -v is misleading URL: https://github.com/apache/maven/pull/117
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java index 52f2053833..d7e66e0e6a 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java @@ -68,7 +68,10 @@ public static String showVersion() version.append( "Java version: " ).append( System.getProperty( "java.version", "<unknown Java version>" ) ).append( ", vendor: " ).append( System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ls ); - version.append( "Java home: " ).append( System.getProperty( "java.home", "<unknown Java home>" ) ).append( ls ); + String javaHome = System.getenv( "JAVA_HOME" ); + javaHome = ( javaHome == null ? "<unknown Java home>" : javaHome ); + version.append( "Java home: " ).append( javaHome ).append( ls ); + version.append( "JRE used: " ).append( System.getProperty( "java.home", "<unknown JRE>" ) ).append( ls ); version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append( System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( ls ); version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append( ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services