I have Java 8 and Java 9 installed on my system (not via Homebrew).
I have my JAVA_HOME env variable setup to point to Java 8 (in my .profile) and I can successful compile programs that require Java 8.
However I'm trying to install a program that also requires Java 8 via Homebrew, but it keeps failing - seemingly because it's trying to build it with Java 9.
Is there a way I can tell Homebrew to only build using Java 8?
Looking at the logs for the failed install strongly suggests Homebrew is trying to use Java 9 (its CFLAGS and PATH include references to "jdk-9", etc.). Where does Homebrew get its environment settings from?
Thanks in advance!