elharo commented on a change in pull request #512:
URL: https://github.com/apache/maven/pull/512#discussion_r675865344



##########
File path: apache-maven/src/assembly/shared/init
##########
@@ -50,14 +50,15 @@ if [ -z "$JAVACMD" ] ; then
 fi
 
 if [ ! -x "$JAVACMD" ] ; then
-  echo "The JAVA_HOME environment variable is not defined correctly" >&2
-  echo "This environment variable is needed to run this program" >&2
-  echo "NB: JAVA_HOME should point to a JDK not a JRE" >&2
+  echo "The JAVA_HOME environment variable is not defined correctly," >&2
+  echo "this environment variable is needed to run this program." >&2
   exit 1
 fi
 
 if [ -z "$JAVA_HOME" ] ; then
   echo "Warning: JAVA_HOME environment variable is not set." >&2
+elif [ ! -x "$JAVA_HOME/bin/javac" ] ; then

Review comment:
       Now that I look at this I see a problem. This is testing that JAVA_HOME 
does not point to a JDK. It is not testing that it does point to a JRE. The 
problem I encountered when I filed the bug was that JAVA_HOME pointed to a 
directory that did not exist. Maybe test also that $JAVA_HOME/bin/java does 
exist? 




-- 
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]


Reply via email to