mirror of https://github.com/apache/kafka.git
kafka-259; Give better error message when trying to run shell scripts without having built/downloaded the jars yet; patched by Ashwanth Fernando; reviewed by Jun Rao
This commit is contained in:
parent
bbb161aa25
commit
436dd25a48
|
@ -65,3 +65,19 @@ else
|
|||
fi
|
||||
|
||||
$JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp $CLASSPATH "$@"
|
||||
|
||||
exitval=$?
|
||||
|
||||
if [ $exitval -eq "1" ] ; then
|
||||
$JAVA $KAFKA_OPTS $KAFKA_JMX_OPTS -cp $CLASSPATH "$@" >& exception.txt
|
||||
exception=`cat exception.txt`
|
||||
noBuildMessage='Please build the project using sbt. Documentation is available at http://kafka.apache.org/'
|
||||
pattern="(Could not find or load main class)|(java\.lang\.NoClassDefFoundError)"
|
||||
match=`echo $exception | grep -E "$pattern"`
|
||||
if [[ -n "$match" ]]; then
|
||||
echo $noBuildMessage
|
||||
fi
|
||||
rm exception.txt
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue