Didier Loiseau created MNG-8156:
-----------------------------------

             Summary: mvn shell script should print the environment variables 
when “The JAVA_HOME environment variable is not defined correctly”
                 Key: MNG-8156
                 URL: https://issues.apache.org/jira/browse/MNG-8156
             Project: Maven
          Issue Type: Improvement
          Components: Command Line
    Affects Versions: 3.9.7
         Environment: Unix
            Reporter: Didier Loiseau


When {{$JAVA_HOME}} is not properly set, it just prints:
{code}
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
{code}
and stops.

This is not very helpful as there is absolutely no indication of what is wrong 
exactly and how to fix it. For instance, in [this Stack Overflow 
question|https://stackoverflow.com/q/78614953/525036], the user had a correct 
{{$JAVA_HOME}}, but it was unknowingly overridden in their {{.mavenrc}}

The command should at least print the values of {{$JAVA_HOME}} and 
{{$JAVACMD}}, and ideally some additional help. Something like:
{quote}
JAVA_HOME: $JAVA_HOME
JAVACMD: $JAVACMD
If this is not what you expect, you should check the environment variables, the 
mavenrc file(s), and ensure that you have execution rights on the java 
executable.
You can try setting environment variable MAVEN_SKIP_RC=true to bypass mavenrc 
temporarily.
{quote}



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

Reply via email to