X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-owen.git;a=blobdiff_plain;f=jpctb;h=c4f2b6e6a241035ebc7f891765b2e5269676af50;hp=28f71c114110dc25bb4a183b4c0d0c7e1808b9b5;hb=refs%2Fheads%2Fmaster;hpb=cde26335b1868186951809ced9700fa9ec4d9dba diff --git a/jpctb b/jpctb index 28f71c1..c4f2b6e 100755 --- a/jpctb +++ b/jpctb @@ -32,6 +32,13 @@ 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,37 +80,83 @@ fi yppdir="${yohoho%/*}" +# this replicates the java-searching logic from yohoho/yohoho: if [ -x "$yppdir/java/bin/java" ]; then - javadir="$yppdir/java" -elif [ x"$JAVA_HOME" != x ] && [ -x "$JAVA_HOME/bin/java" ]; then - javadir="$JAVA_HOME" + yppjava="$yppdir/java/bin/java" +elif [ -x "$JAVA_HOME/bin/java" ]; then + yppjava="$JAVA_HOME/bin/java" else - fail "could not find java runtime system" + set +e + yppjava=`type -p java 2>&1` + set -e +fi + +cat <&2 "control panel failed with exit status $rc"; exit "$rc" ;; +esac + #---------- create the temporary are and link farm ---------- @@ -111,7 +164,7 @@ rm -rf -- "$jtmp" mkdir -- "$jtmp" "$extdir" "$linkfarm" cp "$srcjardir"/PCTB*.jar "$extdir" -lndir -silent "$javadir" "$linkfarm" +cp -Rs "$javadir"/. "$linkfarm"/. #---------- edit the linkfarm to have our jvm wrapper ---------- @@ -119,7 +172,6 @@ wrapper="$linkfarm"/jre/bin/java rm -- "$wrapper" export JPCTB_EXTDIR="$extdir" -export JPCTB_JRE="$javadir/jre" cat <<'END' >"$wrapper" #!/bin/bash