You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2021/06/25 11:10:00 UTC

[jira] [Reopened] (MNG-5025) CLONE - JAVA_HOME auto discovery - also for windows with mvn.bat

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

Robert Scholte reopened MNG-5025:
---------------------------------
      Assignee: Robert Scholte

> CLONE - JAVA_HOME auto discovery - also for windows with mvn.bat
> ----------------------------------------------------------------
>
>                 Key: MNG-5025
>                 URL: https://issues.apache.org/jira/browse/MNG-5025
>             Project: Maven
>          Issue Type: Improvement
>    Affects Versions: 3.0.2
>         Environment: Linux, Ubuntu
>            Reporter: Jochen Stiepel
>            Assignee: Robert Scholte
>            Priority: Minor
>         Attachments: mvn.bat
>
>
> When JAVA_HOME is not set (but java command is in the PATH) then bin/mvn script  prints warning message "Warning: JAVA_HOME environment variable is not set." 
> I don't want to explicitly set JAVA_HOME variable because I manage my JDK instances by update-java-alternatives in Ubuntu. It switches system wide JDK, but does not set the JAVA_HOME variable. If I would set JAVA_HOME manually then any changes made by update-java-alternatives would not be reflected in JAVA_HOME which is obviously incorrect.
> However mvn script can be improved, so that it can guess JAVA_HOME. Actually Groovy startup script does it very well, so I moved auto-discovery code from groovy script to mvn and attach patch here



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