Skip to content

Commit

Permalink
[MNG-5756] Java home output in mvn -v is misleading
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
michael-o committed May 7, 2018
1 parent 8e0efaa commit 9abfc88
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9abfc88

Please sign in to comment.