X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=customizing%2Ffred%2Fjava_profile.sh;h=dad2ae9b9d8a561ae20b9540e7edfe9166260e33;hb=7469e0a5ac9ef28ead37f711e1ff735aca7f90b6;hp=b78309e0aedd80738133473f8ddb9c079403c87a;hpb=53ad0bde08c8df9b68ca5f7f68cd1749987c5073;p=feisty_meow.git diff --git a/customizing/fred/java_profile.sh b/customizing/fred/java_profile.sh index b78309e0..dad2ae9b 100644 --- a/customizing/fred/java_profile.sh +++ b/customizing/fred/java_profile.sh @@ -6,16 +6,7 @@ ############################ -function whichable() -{ - to_find="$1"; shift - which which &>/dev/null - if [ $? -ne 0 ]; then - # there is no which command here. we produce nothing due to this. - echo - fi - echo $(which $to_find) -} +source $FEISTY_MEOW_SCRIPTS/core/functions.sh # this reports when we have totally failed to figure out where a folder # is actually located on the machine. @@ -43,15 +34,21 @@ export JAVA_BIN_PIECE=bin if [ ! -d "$JAVA_HOME" ]; then # first try a recent linux version. - export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre + export JAVA_HOME=/usr/lib/jvm/java-6-sun fi if [ ! -d "$JAVA_HOME" ]; then # try an even more recent version. - export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre + export JAVA_HOME=/usr/lib/jvm/java-7-oracle fi if [ ! -d "$JAVA_HOME" ]; then JAVA_HOME="$(ls -d c:/tools/*jdk* 2>/dev/null)" fi +if [ ! -d "$JAVA_HOME" ]; then + JAVA_HOME="$(ls -d "c:/Program Files"/*jdk* 2>/dev/null)" +fi +if [ ! -d "$JAVA_HOME" ]; then + JAVA_HOME="$(ls -d "c:/Program Files (x86)"/*jdk* 2>/dev/null)" +fi if [ ! -d "$JAVA_HOME" ]; then if [ ! -z "$(grep -i 'd:' /proc/mounts 2>/dev/null)" ]; then # try using a windows version. @@ -89,12 +86,12 @@ if [ ! -d "$ECLIPSE_DIR" ]; then ECLIPSE_DIR="c:/tools/eclipse" fi if [ ! -d "$ECLIPSE_DIR" ]; then - if [ ! -z "$(grep -i 'd:' /proc/mounts)" ]; then + if [ ! -z "$(grep -i 'd:' /proc/mounts 2>/dev/null)" ]; then ECLIPSE_DIR="d:/tools/eclipse" fi fi if [ ! -d "$ECLIPSE_DIR" ]; then - if [ ! -z "$(grep -i 'e:' /proc/mounts)" ]; then + if [ ! -z "$(grep -i 'e:' /proc/mounts 2>/dev/null)" ]; then ECLIPSE_DIR="e:/tools/eclipse" fi fi @@ -133,4 +130,5 @@ fi ############################ +#echo "java_profile: JAVA_HOME='$JAVA_HOME' ECLIPSE_DIR='$ECLIPSE_DIR'"