5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 00:43:42 +08:00

SQOOP-1070: Shell scripts should not rely on $PATH if $JAVA_HOME is set

(Sean Mackrory via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2013-06-09 08:04:59 -07:00
parent 662f18a0a3
commit 6d1779a050

View File

@ -102,7 +102,12 @@ case $COMMAND in
# We need to change current directory back to original as optional user side script # We need to change current directory back to original as optional user side script
# might be specified with relative path. # might be specified with relative path.
cd ${OLD_DIR} cd ${OLD_DIR}
java -classpath ${CLASSPATH} org.apache.sqoop.client.shell.SqoopShell $2
EXEC_JAVA='java'
if [ -n "${JAVA_HOME}" ] ; then
EXEC_JAVA="${JAVA_HOME}/bin/java"
fi
${EXEC_JAVA} -classpath ${CLASSPATH} org.apache.sqoop.client.shell.SqoopShell $2
;; ;;
*) *)