+# try using java itself to locate the JAVA_HOME if we can.
+if [ ! -d "$JAVA_HOME" ]; then
+ JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | grep -i java.home | sed -e 's/.*java.home = \(.*\)$/\1/')
+fi
+
+# if that didn't work, then we try a series of random bizarro places where
+# we have seen java live before.
+
+#hmmm: below list is way out of date. we really hope the first attempt above works.
+