dbflute / dbflute-core

DBFlute core libraries for Java8
http://dbflute.seasar.org/
23 stars 18 forks source link

Improve java home detection #113

Closed little-forest closed 4 years ago

little-forest commented 4 years ago

When JDK is installed via SDKMAN on MacOS, _project.sh can't find JAVA_HOME because these JDKs are not under control of OS, so java_home can't detect them. This PR improve JAVA_HOME detection of _project.sh. For details, please see commit log.

dbflute commented 4 years ago

I will fix it like this after merging:

JAVA_VERSION=1.8+

if [[ -z "${JAVA_HOME}" ]]; then
   if [[ `uname` = "Darwin" ]]; then
     export JAVA_HOME=$(/usr/libexec/java_home -v ${JAVA_VERSION})
   fi
fi