--- usr/bin/eclipse 2007-02-22 11:39:49.000000000 +0100 +++ updated/usr/bin/eclipse 2007-10-19 02:29:26.000000000 +0200 @@ -97,7 +97,27 @@ # If the user has not set JAVA_HOME, cycle through our list of compatible VM's # and pick the first one that exists. if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then - echo "searching for compatible vm..." + echo "trying to use vm given under /etc/alternatives..." + if [ -x "/etc/alternatives/java" ]; then + export JAVA_HOME=`ls -lh /etc/alternatives/java | cut -f10 -d" " | sed -e s/"\/jre\/bin\/java"//g` + echo "ok" + else + echo "not found" + fi +fi + +if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then # if not set... + echo -n "trying to use vm given in /usr/lib/jvm/.*.jinfo..." + if [ -r `ls /usr/lib/jvm/.*.jinfo` -a -x `cat /usr/lib/jvm/.*.jinfo | grep "jre java " | cut -f3 -d" "` ]; then + export JAVA_HOME=`cat /usr/lib/jvva-virtual-machinem/.*.jinfo | grep "jre java " | cut -f3 -d" " | sed -e s/"\/jre\/bin\/java"//g` + echo "ok" + else + echo "not found" + fi +fi + +if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then # if still not set... + echo -n "searching for compatible vm in /etc/eclipse/java_home (this shouldn't happen)..." javahomelist=`cat /etc/eclipse/java_home | grep -v '^#' | grep -v '^$' | while read line ; do echo -n $line ; echo -n ":" ; done` OFS="$IFS" IFS=":"