From: Ian Jackson Date: Sun, 22 Aug 2010 18:37:01 +0000 (+0100) Subject: jpctb: New algorithm for finding java stuff X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-owen.git;a=commitdiff_plain;h=27ad770787f1e70c9ec77065aa3511b9efc71b2d jpctb: New algorithm for finding java stuff --- diff --git a/jpctb b/jpctb index c5bf4aa..5157a05 100755 --- a/jpctb +++ b/jpctb @@ -32,6 +32,12 @@ fail () { echo >&2 "jpctb: $*" exit 127 } + +nojre () { + fail "couldn't find the right jre: $* + perhaps you should make ypp's java symlink (normally yohoho/java) + point to your jre, eg to /usr/lib/jvm/java-6-sun" + badusage () { fail "bad usage: $*" } @@ -73,58 +79,51 @@ fi yppdir="${yohoho%/*}" +# this replicates the java-searching logic from yohoho/yohoho: +if [ -x "$yohoho/java/bin/java" ]; then + yppjava="$yohoho/java/bin/java" +elif [ -x "$JAVA_HOME/bin/java" ]; then + yppjava="$JAVA_HOME/bin/java" +else + set +e + yppjava=`type -p java 2>&1` + set -e +fi + cat <