JAVA_HOME is a requirement
http://maven.apache.org/download.html#installation

Cheers,

Vincent

2006/8/7, Weiqi Gao <[EMAIL PROTECTED]>:
Hi,

I'm learning Maven 2.0.4 and encountered an error when invoking the
mvn script.  The following piece of script seems to be the cause of my
error message:

========================================
if [ -z "$JAVACMD" ] ; then
 if [ -n "$JAVA_HOME"  ] ; then
   if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
     # IBM's JDK on AIX uses strange locations for the executables
     JAVACMD="$JAVA_HOME/jre/sh/java"
   else
     JAVACMD="$JAVA_HOME/bin/java"
   fi
 else
   JAVACMD=java
 fi
fi

if [ ! -x "$JAVACMD" ] ; then
 echo "Error: JAVA_HOME is not defined correctly."
 echo "  We cannot execute $JAVACMD"
 exit 1
fi
========================================

I don't have my JAVA_HOME set, so my JAVACMD has the value of "java"
when the [ -x "$JAVACMD" ] check is done.  Naturally it failed because
the file "java" doesn't exist in the current directory.

It would make more sense to do the [ -x "$JAVACMD" ] check in the [ -n
"JAVA_HOME" ] branch of the if statement in the previous block (when
$JAVACMD is built up).

Thanks,
--
Weiqi Gao (高为奇)
[EMAIL PROTECTED]
http://www.weiqigao.com/blog/

Reply via email to