diff --git a/core/c/find-java-home b/core/c/find-java-home index 9343dcec8..4e982a6c9 100644 --- a/core/c/find-java-home +++ b/core/c/find-java-home @@ -35,8 +35,15 @@ elif [ $UNIXTYPE = "linux" ] && [ -e /etc/arch-release ]; then elif [ $UNIXTYPE = "darwin" ]; then JAVA_HOME=$(/usr/libexec/java_home) elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then + # Even though the kernel is FreeBSD's, the userland is GNU. + # kFreeBSD has $JAVA_HOME/include/linux instead of $JAVA_HOME/include/*bsd UNIXTYPE="linux" - if [ -d /usr/lib/jvm/java-gcj ]; then + # OpenJDK 7 is supported as of Debian Jessie + if [ -d /usr/lib/jvm/java-7-openjdk-kfreebsd-amd64/ ]; then + JAVA_HOME="/usr/lib/jvm/java-7-openjdk-kfreebsd-amd64" + elif [ -d /usr/lib/jvm/java-7-openjdk-kfreebsd-i386/ ]; then + JAVA_HOME="/usr/lib/jvm/java-7-openjdk-kfreebsd-i386" + elif [ -d /usr/lib/jvm/java-gcj ]; then JAVA_HOME="/usr/lib/jvm/java-gcj" fi fi