When I type mvn --version in ubuntu from the terminal(ubuntu),I get the below output.
Warning: JAVA_HOME environment variable is not set.
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-32-generic", arch: "amd64", family: "unix"
When I did not set any JAVA_HOME environment variable , how is maven getting the java home installed path.Is it trying to find this path from the /usr/bin/java command which is installed in my system and if so why is it taking the path till jre.
P.S : Also I could not find any java path in any maven config.
Thanks.
As showed in the CLIReportingUtils.java
(the maven class that retrieves the Java Home), the value comes from the following call :
System.getProperty( "java.home", "<unknown java home>" )
The java.home
is for the JRE unlike the JAVA_HOME
which is for the JDK.
So Maven is displaying the JRE home.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With