Subject: | Java commands are not found on recent Mac OS X |
I'm using macOS Sierra (10.12.6), vanilla Java installation.
$JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home. It contains a subdirectory "bin" but not "Commands" as expected by Makefile.PL.
/usr/bin/javac is a symbolic link to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
I don't have access to other macOS or Java versions so I have no idea how to portably solve this. Maybe Java::Portable should return an array for J2SDK_BIN so that multiple locations are searched?
In any case, J2SDK_BIN for darwin should give "bin" as this seems to be the more recent location.
If anybody runs into the same problem: Manually change Inline-Java/Java/Portable.pm (replace "Commands" with "bin") or
sudo ln -s ${JAVA_HOME}/bin ${JAVA_HOME}/Commands
before you build the extension.