I am attempting to install jpy into a python 3.12 development environment on Mac OSX M1. As is standard, brew is used to install most dependencies. jenv is used to switch between JDKs -- including switching JAVA_HOME.
Collecting jpy
Downloading jpy-0.14.0.tar.gz (172 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.2/172.2 kB 1.4 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
Error: environment variable "JAVA_HOME" must be set to a JDK (>= v1.7) installation directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
In this case when jpy tries to build against OpenJDK, it claims JAVA_HOME is not set.
I am attempting to install jpy into a python 3.12 development environment on Mac OSX M1. As is standard,
brew
is used to install most dependencies.jenv
is used to switch between JDKs -- including switchingJAVA_HOME
.Case 1 --
zulu64-21.0.1
JDK (BUILD WORKS)Here the Zulu JDK was installed from https://www.azul.com/downloads/?package=jdk#zulu.
The directory structure of Zulu is:
Note that there is a
lib
directory and nolibexec
directory.(Run these lines one at a time so that env vars get set right)
It works:
Case 2 -- OpenJDK@17 (BUILD FAILS)
Here OpenJDK@17 is installed using
brew install openjdk@17
.The directory structure of OpenJDK is:
Note that there is a
libexec
directory and nolib
directory.(Run these lines one at a time so that env vars get set right)
It fails:
In this case when jpy tries to build against OpenJDK, it claims
JAVA_HOME
is not set.Soruce of the problem
The error message is coming from https://github.com/jpy-consortium/jpy/blob/14b19a72371c473f022b668965f5b62036536ab8/setup.py#L104 because
jdk_home_dir
is None. This is coming from https://github.com/jpy-consortium/jpy/blob/14b19a72371c473f022b668965f5b62036536ab8/jpyutil.py#L143. Here there is a requirement that there be alib
dir without also checking for alibexec
dir.