Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1735

Using GraalVM toolchain causes NPE when default JAVA_HOME is not set to GraalVM JDK's home

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M4
    • None
    • Maven Surefire Plugin
    • None

    Description

      When I use toolchains and configure GraalVM as the active toolchain AND my default JDK is NOT GraalVM (JAVA_HOME != GraalVM) I'm getting NPE from surefire plugin

      Caused by: java.lang.NullPointerException

          at org.apache.maven.surefire.booter.SystemUtils.toJdkVersionFromReleaseFile (SystemUtils.java:141)

          at org.apache.maven.surefire.booter.SystemUtils.isJava9AtLeast (SystemUtils.java:215)

          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getEffectiveJvm (AbstractSurefireMojo.java:2446)

       

      It works fine when I change JAVA_HOME to point to GraalVM home.

      The reason is that https://github.com/apache/maven-surefire/blob/master/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java try to read JAVA_VERSION from releases file and GraalVM doesn't have this variable there.

      I'm not sure who is at fault, maybe GraalVM should export that var.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kopper Adam Czepil
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: