fix apple jdk detection

This fixes JAVA_HOME being falsely set, resulting in the following error:
```
Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/libexec/java_home/bin/java
```