chiark / gitweb /
jpctb: cope if java binary is in jre1.yada
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 24 Aug 2010 23:16:23 +0000 (00:16 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 24 Aug 2010 23:38:54 +0000 (00:38 +0100)
jpctb

diff --git a/jpctb b/jpctb
index 54c1f41..3557cd2 100755 (executable)
--- a/jpctb
+++ b/jpctb
@@ -124,13 +124,19 @@ else
        absjava=`readlink -f "$yppjava"`
        echo "   abs. java:    \"$absjava\""
        case "$absjava" in
-       */jre/bin/java)
-               echo "   found jre directory, good"
-               javadir="${absjava%/jre/bin/java}"
+       */*/bin/java)
+               javadir="${absjava%/bin/java}"
+               jreleaf="${javadir##*/}"
+               javadir="${javadir%/*}"
+               echo "   jre leaf dir: \"$jreleaf\""
+               case "$jreleaf" in
+               jre)    echo "   found jre directory, good";;
+               jre1.*) echo "   found versioned jre directory $jreleaf, ok";;
+               *)      nojre "java binary not in jre dir ($jreleaf)";;
+               esac
                ;;
        *)
-               nojre "java binary not in jre dir"
-               ;;
+               nojre "real java binary not in ../bin/java dir";;
        esac
 fi
 
@@ -144,7 +150,7 @@ jtmp="$jpctbdir/tmp"
 linkfarm="$jtmp/linkfarm"
 extdir="$jtmp/ext"
 
-export JPCTB_JRE="$javadir/jre"
+export JPCTB_JRE="$javadir/$jreleaf"
 
 #---------- confirm for the user which paths we're using ----------
 
@@ -185,7 +191,7 @@ cp -Rs "$javadir"/. "$linkfarm"/.
 
 #---------- edit the linkfarm to have our jvm wrapper ----------
 
-wrapper="$linkfarm"/jre/bin/java
+wrapper="$linkfarm"/$jreleaf/bin/java
 rm -- "$wrapper"
 
 export JPCTB_EXTDIR="$extdir"
@@ -234,4 +240,4 @@ chmod +x -- "$wrapper"
 
 #---------- now run it ----------
 
-exec $setup_only_simulate "$yohoho" -Djava.home="$linkfarm/jre"
+exec $setup_only_simulate "$yohoho" -Djava.home="$linkfarm/$jreleaf"