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

Hudson commented on MNG-6003:
-----------------------------

SUCCESS: Integrated in maven-3.x #1261 (See 
[https://builds.apache.org/job/maven-3.x/1261/])
[MNG-6003] Drastically reduce JAVA_HOME discovery code (michaelo: rev 
6c4627bd463dc080cb00c01a27b4ff830cbd5702)
* apache-maven/src/bin/mvn
* apache-maven/src/bin/mvn.cmd


> Drastically reduce JAVA_HOME discovery code
> -------------------------------------------
>
>                 Key: MNG-6003
>                 URL: https://issues.apache.org/jira/browse/MNG-6003
>             Project: Maven
>          Issue Type: Improvement
>          Components: Command Line
>    Affects Versions: 3.3.9
>            Reporter: Michael Osipov
>            Assignee: Michael Osipov
>             Fix For: 3.4.0
>
>
> Our [installation documentation|https://maven.apache.org/install.html] 
> several times requires that {{JAVA_HOME}} is set and points to a valid JDK. 
> Though, tens of lines in {{mvn}} and {{mvn.cmd}} perform some magic to 
> discover it when it is not set. This completely contradicts our requirement 
> that {{JAVA_HOME}} must be set.
> We can drastically reduce this code by checking if {{JAVA_HOME}} is set and 
> use it, if not perform {{which java}} and use that to run Maven. Not adhering 
> to our requirements is deemed to undefined behavior. A developer must be able 
> to set this simple env var properly. In most cases on Unix/Linux OpenJDK is 
> installed anyway which means that {{which java}} points to a JDK anyway. For 
> instance, the {{JAVA_HOME}} discovery on FreeBSD competely fails and sets it 
> to {{/usr/local}} because {{/usr/local/bin/java}} is actually a wrapper 
> script.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to