Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.3.9
-
None
Description
Our installation documentation 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.
Attachments
Issue Links
- is depended upon by
-
MNG-5579 Unify error output/check logic from shell and batch scripts
- Closed
- is duplicated by
-
MNG-5025 CLONE - JAVA_HOME auto discovery - also for windows with mvn.cmd
- Closed
- is related to
-
MNG-6456 Log $JAVA_HOME when there is an issue with it
- Closed
-
MWRAPPER-27 rework mvnw* scripts to better match mvn* from Maven 3.8
- Closed
- mentioned in
-
Page Loading...