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 52f2053833fa..d7e66e0e6a64 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", "" ) ).append( ", vendor: " ).append( System.getProperty( "java.vendor", "" ) ).append( ls ); - version.append( "Java home: " ).append( System.getProperty( "java.home", "" ) ).append( ls ); + String javaHome = System.getenv( "JAVA_HOME" ); + javaHome = ( javaHome == null ? "" : javaHome ); + version.append( "Java home: " ).append( javaHome ).append( ls ); + version.append( "JRE used: " ).append( System.getProperty( "java.home", "" ) ).append( ls ); version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append( System.getProperty( "file.encoding", "" ) ).append( ls ); version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append(