Added test if final java command exists and is executable and print

a decent error message if not.
This commit is contained in:
hns 2003-07-01 16:13:41 +00:00
parent 3d3b839395
commit 7476233449
3 changed files with 24 additions and 3 deletions

View file

@ -32,13 +32,20 @@ else
JAVACMD=java
fi
# Check if java command is executable
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit
fi
# Get the Helma installation directory
INSTALL_DIR="${0%/*}"
cd $INSTALL_DIR
INSTALL_DIR=$PWD
# get HOP_HOME variable if it isn't set
if test -z "$HOP_HOME"; then
if [ -z "$HOP_HOME" ]; then
# try to get HOP_HOME from script file and pwd
# strip everyting behind last slash
HOP_HOME="${0%/*}"

View file

@ -32,13 +32,20 @@ else
JAVACMD=java
fi
# Check if java command is executable
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit
fi
# Get the Helma installation directory
INSTALL_DIR="${0%/*}"
cd $INSTALL_DIR
INSTALL_DIR=$PWD
# get HOP_HOME variable if it isn't set
if test -z "$HOP_HOME"; then
if [ -z "$HOP_HOME" ]; then
# try to get HOP_HOME from script file and pwd
# strip everyting behind last slash
HOP_HOME="${0%/*}"

9
hop.sh
View file

@ -32,13 +32,20 @@ else
JAVACMD=java
fi
# Check if java command is executable
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit
fi
# Get the Helma installation directory
INSTALL_DIR="${0%/*}"
cd $INSTALL_DIR
INSTALL_DIR=$PWD
# get HOP_HOME variable if it isn't set
if test -z "$HOP_HOME"; then
if [ -z "$HOP_HOME" ]; then
# try to get HOP_HOME from script file and pwd
# strip everyting behind last slash
HOP_HOME="${0%/*}"