Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6108

Maven selects wrong JVM

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.3.9
    • Fix Version/s: 3.3.9
    • Component/s: Command Line
    • Labels:
      None
    • Environment:
      Windows 7, Java 8

      Description

      Hi,

      I am using Mavn 3.3.9:

      $ which mvn
      /d/opt/apache-maven-3.3.9/bin/mvn

      I intend to use an installed SDK 1.8.0_102:

      $ which mvn
      /d/opt/apache-maven-3.3.9/bin/mvn
      
      $ echo $JAVA_HOME
      d:/opt/jdk1.8.0_102
      $ which java
      /d/opt/jdk1.8.0_102/bin/java

      Nevertheless, Maven is constantly using Java 1.8.0_111. Which is a problem, because that is a JRE, and not an SDK:

      $ mvn -Pjenkins -U clean install
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Ant Plugin 1.5-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] --- maven-clean-plugin:2.6:clean (default-clean) @ ant ---
      [INFO] Deleting D:\Users\JochenWiedmann\git\jenkins\ant-plugin\target
      [INFO]
      [INFO] --- maven-hpi-plugin:1.120:validate (default-validate) @ ant ---
      [INFO]
      [INFO] --- maven-enforcer-plugin:1.3.1:display-info (display-info) @ ant ---
      [INFO] Maven Version: 3.3.9
      [INFO] JDK Version: 1.8.0_111 normalized as: 1.8.0-111
      
      
      $ java -version
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

      The problem is perhaps understandable, if you look at this:

      $ /d/opt/jdk1.8.0_102/bin/java -version
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

      But, anyways: How can I lock down the JVM, that Maven is using?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jochen@apache.org Jochen Wiedmann
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: