From 9abfc88425601da4e756a80768c2215bb97e9725 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 6 May 2018 00:01:55 +0200 Subject: [PATCH] [MNG-5756] Java home output in mvn -v is misleading The Java home displayed corresponds to the property 'java.home' which points to the JRE installation running the given Maven instance. It is not the value of $JAVA_HOME which causes confusion. Ref: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html This closes #115 and #117. --- .../main/java/org/apache/maven/cli/CLIReportingUtils.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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..e1a4c2f59339 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 @@ -63,12 +63,11 @@ public static String showVersion() properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home", "" ) ) ) - .append( - ls ); + .append( ls ); 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 ); + System.getProperty( "java.vendor", "" ) ).append( ", runtime: " ).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(