Commit b4d46398 authored by Daryl Herzmann's avatar Daryl Herzmann Committed by akrherz

OF-746 Use update-alternatives to find JAVA_HOME on Debian


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13966 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4d26396e
......@@ -22,24 +22,11 @@
# Attempt to locate JAVA_HOME
if [ -z $JAVA_HOME ]; then
JAVA_HOMES="/usr/lib/jvm/default-java \
/usr/lib/jvm/java-7-oracle \
/usr/lib/jvm/java-7-sun \
/usr/lib/jvm/java-6-oracle \
/usr/lib/jvm/java-6-sun \
/usr/lib/jvm/java-1.5.0-sun \
/usr/lib/jvm/java-7-openjdk-amd64 \
/usr/lib/jvm/java-7-openjdk-i386 \
/usr/lib/jvm/java-7-openjdk \
/usr/lib/jvm/java-6-openjdk-amd64 \
/usr/lib/jvm/java-6-openjdk-i386 \
/usr/lib/jvm/java-6-openjdk"
for t in $JAVA_HOMES ; do
if [ -d $t ] ; then
JAVA_HOME=$t
break;
fi
done
JAVA_HOME=$(LC_ALL=C update-alternatives --display java \
| grep best \
| grep -oe \/.*\.java \
| sed 's/\/jre\/.*//g')
echo "best java alternative in: "$JAVA_HOME
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin:${JAVA_HOME}/bin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment