X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcustomize%2Ffred%2Fjava_profile.sh;fp=scripts%2Fcustomize%2Ffred%2Fjava_profile.sh;h=f98030a679856d2d5dcec81fa4dcb87fabe4e23a;hb=87950dbd8c16d3216c25bcfc781733908968a4fc;hp=b8e71a33b4827f2d67127d93a6c14e691a938703;hpb=95d216b2381107474bea0a65a915936a5402df0f;p=feisty_meow.git diff --git a/scripts/customize/fred/java_profile.sh b/scripts/customize/fred/java_profile.sh index b8e71a33..f98030a6 100644 --- a/scripts/customize/fred/java_profile.sh +++ b/scripts/customize/fred/java_profile.sh @@ -22,16 +22,24 @@ function intuition_failure() ############################ -# set some fairly liberal limits for ant. -#no. export ANT_OPTS="-Xms512m -Xmx768m -XX:MaxPermSize=768m" - -############################ - # start guessing some settings... +# whatever we figure out, we want to export the java home variable. +export JAVA_HOME + # this bin portion works for most javas... export JAVA_BIN_PIECE=bin +# 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. + if [ ! -d "$JAVA_HOME" ]; then # try a recent version. export JAVA_HOME=/usr/lib/jvm/java-8-oracle