I see more and more folks with whacked versions of java configured in /usr/java/default or /usr/lib/jvm/default-java that are pointing to 32-bit JVMs or are simply not even a 1.6 JVM. I was wondering if we could do a bit more intelligence in this script and run a java -version to rule out a 32-bit JVM or a 1.7 JDK? Or would that be too error prone?
if [ -z "$JAVA_HOME" ]; then
for candidate in \
/usr/lib/jvm/jre-1.6.0-openjdk* ; do
if [ -e $candidate/bin/java ]; then