From fbca09ad86ec699ff1502f142197abb4dd7540e6 Mon Sep 17 00:00:00 2001 From: Ashwanth Fernando Date: Wed, 29 May 2013 16:10:55 -0700 Subject: [PATCH] KAFKA-259 --- bin/kafka-run-class.sh | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index e055d67..8f9e806 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -81,3 +81,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 + + -- 1.7.5.4