elharo commented on code in PR #476:
URL: https://github.com/apache/maven-wrapper/pull/476#discussion_r4587019884
##########
maven-wrapper-distribution/src/resources/only-mvnw:
##########
@@ -52,13 +52,19 @@ set_java_home() {
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
+ fi
+ JARCMD="$JAVA_HOME/bin/jar"
+ if [ ! -x "$JARCMD" ]; then
+ JARCMD="$JAVA_HOME/jre/bin/jar"
+ fi
- if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
+ for cmd in "$JAVACMD" "$JAVACCMD" "$JARCMD"; do
+ if [ ! -x "$cmd" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so
mvnw cannot run." >&2
- echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\"
or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"$cmd\" does not exist
or is not executable." >&2
Review Comment:
"is not executable" seems unlikely, but again if that is the problem say
that and only that. Do not use "or". Be as specific as possible about the
actual problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]