[ 
https://issues.apache.org/jira/browse/SUREFIRE-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852424#comment-17852424
 ] 

ASF GitHub Bot commented on SUREFIRE-1939:
------------------------------------------

michael-o commented on PR #387:
URL: https://github.com/apache/maven-surefire/pull/387#issuecomment-2149685198

   I have created a new PR addressing this: #743. @CMoH, your approach is 
appreciated, but it solves only the symptom, not the cause. Look at the 
signature: 
https://github.com/apache/maven-surefire/blob/e166d93e13191b52c26291f6d5ef0bf83a5b97c8/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java#L148.
 It expects a path to the Java executable and nothing else, not a JDK/JRE/Java 
home. Therefore, invalid data leads to undefined behavior, you see an NPE in 
this case.




> Build fails if java.home has <=2 path components
> ------------------------------------------------
>
>                 Key: SUREFIRE-1939
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1939
>             Project: Maven Surefire
>          Issue Type: Bug
>         Environment: Gentoo Linux openjdk-bin-11.0.11_p9
>            Reporter: Ciprian Ciubotariu
>            Assignee: Michael Osipov
>            Priority: Trivial
>             Fix For: 3.3.0
>
>
> For {{JAVA_HOME=/opt/openjdk-bin-11.0.11_p9}}, 
> {{SystemUtilsTest.PlainUnitTests.incorrectJdkPath()}} throws a NPE at 
> {{SystemUtils.toJdkHomeFromJvmExec(SystemUtils.java:91)}}.
> Trivial fix will follow soon



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to