From 271c4a2f36c3ed45d312a762f3ba34faab54b3a1 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 21 Nov 2005 22:42:41 +0000 Subject: [PATCH] always call $JAVA_HOME/bin/java git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@348004 13f79535-47bb-0310-9956-ffa450edef68 --- bootstrap.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index a6738b270f..5d38f1a7f3 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -3,11 +3,18 @@ ARGS=$@ ORIG_ARGS=$ARGS +if [ -z "$JAVA_HOME" ]; then + echo You must specify the JAVA_HOME environment variable + exit 1 +fi + +JAVACMD="$JAVA_HOME/bin/java" + ( cd bootstrap/bootstrap-mini ./build ret=$?; if [ $ret != 0 ]; then exit $ret; fi - java $MAVEN_OPTS -jar bootstrap-mini.jar install $ARGS + $JAVACMD $MAVEN_OPTS -jar bootstrap-mini.jar install $ARGS ret=$?; if [ $ret != 0 ]; then exit $ret; fi ) ret=$?; if [ $ret != 0 ]; then exit $ret; fi @@ -16,7 +23,7 @@ BOOTSTRAP_JAR=bootstrap-mini/bootstrap-mini.jar ( cd bootstrap/bootstrap-installer - java $MAVEN_OPTS -jar ../$BOOTSTRAP_JAR package $ARGS + $JAVACMD $MAVEN_OPTS -jar ../$BOOTSTRAP_JAR package $ARGS ret=$?; if [ $ret != 0 ]; then exit $ret; fi ) ret=$?; if [ $ret != 0 ]; then exit $ret; fi @@ -42,7 +49,7 @@ fi OLD_M2_HOME=$M2_HOME unset M2_HOME -java $MAVEN_OPTS -jar bootstrap/bootstrap-installer/target/bootstrap-installer.jar --prefix=$PREFIX $ARGS +$JAVACMD $MAVEN_OPTS -jar bootstrap/bootstrap-installer/target/bootstrap-installer.jar --prefix=$PREFIX $ARGS ret=$?; if [ $ret != 0 ]; then exit $ret; fi M2_HOME=$OLD_M2_HOME export M2_HOME @@ -52,7 +59,7 @@ ARGS=$ORIG_ARGS ( # TODO: should w ebe going back to the mini now that we have the real thing? cd maven-core-it-verifier - java $MAVEN_OPTS -jar ../bootstrap/$BOOTSTRAP_JAR package $ARGS + $JAVACMD $MAVEN_OPTS -jar ../bootstrap/$BOOTSTRAP_JAR package $ARGS ret=$?; if [ $ret != 0 ]; then exit $ret; fi ) ret=$?; if [ $ret != 0 ]; then exit $ret; fi