Installing python-bioformats (javac invalid source release)

Hi,

I am trying to install python-bioformats with pip (running MacOS 10.14.6).

I get the following error when it is trying to install javabridge:

running build_ext
javac -source 8 -target 8 /private/var/folders/qm/nq1qnwf91glfhvvwnpl2z5dw0000gn/T/pip-install-ee738xkd/python-javabridge/java/org/cellprofiler/runnablequeue/RunnableQueue.java
javac: invalid source release: 8

If I look for Java, I get:

echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

I have no idea where the ‘-source 8 -target 8’ is coming from or how to fix it.

Sorry if this has been answered, I could not find anything with the same error on the forum. Thanks.

I’m not sure if the current build of python-bioformats and/or python-javabridge run on Java 6- can you try installing Java8 or later, setting that to your JAVA_HOME, and then reinstalling python-javabridge again?

Amazing, thank you! I didn’t know that 1.6 and 1.8 = Java 6 and Java 8.

In case anyone else comes across this, it is also confusing because when I looked at the Mac Java control panel, I did have Java 8, but apparently that is not the same as having the JDK. After I installed the most recent JDK from Oracle and set that to JAVA_HOME, it now installs.

/usr/libexec/java_home -V
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home