I can't find the root cause of this script's error. Can anybody help me? Thanks in advance. Here is the whole script detail.
#!/bin/sh
CWD=`pwd`
LAUNCH_DIRECTORY=`eval dirname $0`
cd $LAUNCH_DIRECTORY
LAUNCH_DIRECTORY=`pwd`
cd $CWD
if [ -d "${LAUNCH_DIRECTORY}/java/bin" ]; then
JAVA_HOME=${LAUNCH_DIRECTORY}/java
fi
if [ "${JAVA_HOME}" != "" ]; then
PATH=${JAVA_HOME}/bin:${PATH}
fi
JAVA_VERSION=$(java -version 2>&1 | grep -i version | \
cut -d'"' -f2 | cut - d'.' -f2)
if [ -z "${JAVA_VERSION}" ] || [ "${JAVA_VERSION}" -lt 8 ]; then
YAB_JAVA_OPTS="-XX:MaxPermSize=256m ${YAB_JAVA_OPTS}"
fi
export TERM=xterm
java ${YAB_JAVA_OPTS} \
-Dlaunch.dir="${LAUNCH_DIRECTORY}" \
-jar "${LAUNCH_DIRECTORY}/lib/yab-loader.jar" ${YAB_OPTS} ${1+"$@"}