[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.
This commit is contained in:
Michael Osipov 2018-05-06 00:01:55 +02:00
parent 8e0efaa107
commit 9abfc88425
1 changed files with 3 additions and 4 deletions

View File

@ -63,12 +63,11 @@ public static String showVersion()
properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home",
"<unknown Maven "
+ "home>" ) ) )
.append(
ls );
.append( ls );
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 );
System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ", runtime: " ).append(
System.getProperty( "java.home", "<unknown runtime>" ) ).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(