From f7c4572cbc442817ff45adbc0f6a08ccf1f46683 Mon Sep 17 00:00:00 2001 From: Balazs Meszaros Date: Tue, 13 Mar 2018 16:38:46 +0100 Subject: [PATCH] HBASE-20187 Shell startup fails with IncompatibleClassChangeError --- bin/hbase | 41 +++++++++++++++++------------------------ hbase-assembly/pom.xml | 2 +- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/bin/hbase b/bin/hbase index 70cae9cb51..329282beff 100755 --- a/bin/hbase +++ b/bin/hbase @@ -169,22 +169,6 @@ if [ -d "$HBASE_HOME/hbase-server/target/hbase-webapps" ]; then fi fi -add_maven_deps_to_classpath() { - f="${HBASE_HOME}/hbase-build-configuration/target/cached_classpath.txt" - if [ ! -f "${f}" ] - then - echo "As this is a development environment, we need ${f} to be generated from maven (command: mvn install -DskipTests)" - exit 1 - fi - CLASSPATH=${CLASSPATH}:`cat "${f}"` -} - - -#Add the development env class path stuff -if $in_dev_env; then - add_maven_deps_to_classpath -fi - #add the hbase jars for each module for f in $HBASE_HOME/hbase-jars/hbase*.jar; do if [[ $f = *sources.jar ]] @@ -316,6 +300,22 @@ for cmd in "${jruby_cmds[@]}"; do fi done +#Add the development env class path stuff +if $in_dev_env; then + if [[ $jruby_needed ]]; then + f="${HBASE_HOME}/hbase-build-configuration/target/cached_classpath_jruby.txt" + else + f="${HBASE_HOME}/hbase-build-configuration/target/cached_classpath.txt" + fi + + if [ ! -f "${f}" ] + then + echo "As this is a development environment, we need ${f} to be generated from maven (command: mvn install -DskipTests)" + exit 1 + fi + CLASSPATH=${CLASSPATH}:$(cat "${f}") +fi + # the command needs jruby if [[ $jruby_needed ]]; then if [ "$JRUBY_HOME" != "" ]; then # JRUBY_HOME is specified explicitly, eg. export JRUBY_HOME=/usr/local/share/jruby @@ -326,14 +326,7 @@ if [[ $jruby_needed ]]; then HBASE_OPTS="$HBASE_OPTS -Djruby.home=$JRUBY_HOME -Djruby.lib=$JRUBY_HOME/lib" else # JRUBY_HOME is not specified explicitly - if $in_dev_env; then # in dev environment - F_JRUBY="${HBASE_HOME}/hbase-build-configuration/target/cached_classpath_jruby.txt" - if [ ! -f "${F_JRUBY}" ]; then - echo "As this is a development environment, we need ${F_JRUBY} to be generated from maven (command: mvn install -DskipTests)" - exit 1 - fi - CLASSPATH=$(cat "${F_JRUBY}"):$CLASSPATH; - else # not in dev environment + if ! $in_dev_env; then # not in dev environment # add jruby packaged with HBase to CLASSPATH JRUBY_PACKAGED_WITH_HBASE="$HBASE_HOME/lib/ruby/*.jar" for jruby_jar in $JRUBY_PACKAGED_WITH_HBASE; do diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index eda6491495..79eeef98d3 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -109,7 +109,7 @@ ${project.parent.basedir}/target/cached_classpath_jruby.txt - jruby-complete + jline -- 2.16.1