maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Heinz Marbaise (JIRA)" <>
Subject [jira] [Commented] (MNG-6501) Maven always picks the JRE path as java.home
Date Fri, 02 Nov 2018 18:16:00 GMT


Karl Heinz Marbaise commented on MNG-6501:

Hm..If I call a {{mvn --version}} on my Mac with Maven 3.6.0 it looks like this:
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /usr/local/maven
Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
It looks like it would point to JRE but I can compile and build etc. without any issue...

Furthermore can you please add a full log output {{mvn -X ..}} in the situation where your
build fails....Apart from that I would recommend to remove the setting of {{M2_HOME}} in particular
in Jenkins builds. Apart from that I would ask why you need to use Ant in a Maven build? Please
add the pom file as well....

> Maven always picks the JRE path as java.home
> --------------------------------------------
>                 Key: MNG-6501
>                 URL:
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.3
>            Reporter: Joseph
>            Priority: Blocker
>         Attachments: maven_jdk.png
> we set the proper JDK directory as JAVA_HOME in the environment variable. but the maven
is forcefully picking up JRE_HOME.
> Even though the JAVA_HOME is pointing to the proper JDK path.
> $ echo $JAVA_HOME
> */apps/dftjenkins/local/java/jdk1.8.0_102*
> $ ls -lrt ${JAVA_HOME}/bin/javac
> -rwxr-xr-x. 1 dftjenkins cisco 7941 Jun 22  2016 */apps/dftjenkins/local/java/jdk1.8.0_102/bin/javac*
> $ echo $M2_HOME
> /apps/dftjenkins/local/apache-maven/apache-maven-3.2.3
> Maven is picking the JRE path as java.home
> $ mvn -v
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support
was removed in 8.0
> Picked up _JAVA_OPTIONS:
> Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
> Maven home: /apps/dftjenkins/local/apache-maven/current
> Java version: 1.8.0_102, vendor: Oracle Corporation
> *Java home: /apps/dftjenkins/local/java/jdk1.8.0_102/jre*
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.10.0-693.11.6.el7.x86_64", arch: "amd64", family: "unix"
>  This issue impact the ant call from maven execution . because java.home is pointing
to JRE_HOME and the ant compilation fails with 
> [ERROR] Perhaps JAVA_HOME does not point to the JDK.
> [ERROR] It is currently set to "/apps/dftjenkins/local/java/jdk1.8.0_102/jre"

This message was sent by Atlassian JIRA

View raw message