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 @@ ...@@ -22,24 +22,11 @@
# Attempt to locate JAVA_HOME # Attempt to locate JAVA_HOME
if [ -z $JAVA_HOME ]; then if [ -z $JAVA_HOME ]; then
JAVA_HOMES="/usr/lib/jvm/default-java \ JAVA_HOME=$(LC_ALL=C update-alternatives --display java \
/usr/lib/jvm/java-7-oracle \ | grep best \
/usr/lib/jvm/java-7-sun \ | grep -oe \/.*\.java \
/usr/lib/jvm/java-6-oracle \ | sed 's/\/jre\/.*//g')
/usr/lib/jvm/java-6-sun \ echo "best java alternative in: "$JAVA_HOME
/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
fi fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin:${JAVA_HOME}/bin 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