Skip to content

Commit 9abfc88

Browse files
committed
[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.
1 parent 8e0efaa commit 9abfc88

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ public static String showVersion()
6363
properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home",
6464
"<unknown Maven "
6565
+ "home>" ) ) )
66-
.append(
67-
ls );
66+
.append( ls );
6867
version.append( "Java version: " ).append(
6968
System.getProperty( "java.version", "<unknown Java version>" ) ).append( ", vendor: " ).append(
70-
System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ls );
71-
version.append( "Java home: " ).append( System.getProperty( "java.home", "<unknown Java home>" ) ).append( ls );
69+
System.getProperty( "java.vendor", "<unknown vendor>" ) ).append( ", runtime: " ).append(
70+
System.getProperty( "java.home", "<unknown runtime>" ) ).append( ls );
7271
version.append( "Default locale: " ).append( Locale.getDefault() ).append( ", platform encoding: " ).append(
7372
System.getProperty( "file.encoding", "<unknown encoding>" ) ).append( ls );
7473
version.append( "OS name: \"" ).append( Os.OS_NAME ).append( "\", version: \"" ).append( Os.OS_VERSION ).append(

0 commit comments

Comments
 (0)