You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Adam Czepil (Jira)" <ji...@apache.org> on 2019/12/06 06:29:00 UTC

[jira] [Updated] (SUREFIRE-1735) Using GraalVM toolchain causes NPE when default JAVA_HOME is not set to GraalVM JDK's home

     [ https://issues.apache.org/jira/browse/SUREFIRE-1735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Czepil updated SUREFIRE-1735:
----------------------------------
    Summary: Using GraalVM toolchain causes NPE when default JAVA_HOME is not set to GraalVM JDK's home  (was: Using GraalVM toolchain causes NPE when default java is not set to GraalVM JDK)

> Using GraalVM toolchain causes NPE when default JAVA_HOME is not set to GraalVM JDK's home
> ------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1735
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1735
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 3.0.0-M4
>            Reporter: Adam Czepil
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)