Closed johanneskastl closed 12 months ago
Setting environment variable JPY_LOG_LEVEL=DEBUG
may provide more useful logging.
We do publish wheels to PyPi for Linux Python (3.9|3.10|3.11) (x86_64|aarch64) - are you not able to depend on these?
Our official build procedure runs on GH Actions, and essentially runs python setup.py bdist_wheel --dist-dir dist.linux
. See https://github.com/jpy-consortium/jpy/blob/v0.13.0/.github/workflows/build.yml, https://github.com/jpy-consortium/jpy/blob/v0.13.0/.github/env/Linux/bdist-wheel.sh. It looks like you are invoking a different build command (pip wheel ...
). I'd suggest trying to more closely match how bdist-wheel.sh works if debug logging doesn't provide more insights.
Thanks for the reply. Unfortunately the DEBUG did only help a little.
[ 26s] Running command Preparing metadata (pyproject.toml)
[ 27s] jpyutil - DEBUG: Checking Maven for JAVA_HOME...
[ 27s] jpyutil - DEBUG: Maven not found on PATH. No JAVA_HOME found.
[ 27s] Error: environment variable "JAVA_HOME" must be set to a JDK (>= v1.7) installation directory
[ 27s] error: subprocess-exited-with-error
[ 27s]
After also installing maven the build still fails:
[ 8s] Running command Preparing metadata (pyproject.toml)
[ 8s] jpyutil - DEBUG: Checking Maven for JAVA_HOME...
[ 8s] Error: environment variable "JAVA_HOME" must be set to a JDK (>= v1.7) installation directory
[ 8s] error: subprocess-exited-with-error
Not sure what maven requires inside the JAVA_HOME, but it seems like it cannot find it...
...
JDK_HOME_VARS = ('JPY_JAVA_HOME', 'JPY_JDK_HOME', 'JAVA_HOME', 'JDK_HOME',)
...
def find_jdk_home_dir():
"""
Try to detect the JDK home directory from Maven, if available, or use
dedicated environment variables.
:return: pathname if found, else None
"""
for name in JDK_HOME_VARS:
jdk_home_dir = os.environ.get(name, None)
if jdk_home_dir \
and os.path.exists(os.path.join(jdk_home_dir, 'include')) \
and os.path.exists(os.path.join(jdk_home_dir, 'lib')):
return jdk_home_dir
logger.debug('Checking Maven for JAVA_HOME...')
...
The procedure for installing is checking to make sure the "include" and "lib" dir exists - I see in your setup the "include" dir doesn't. There may be an additional openjdk package you may need to install? (One that is JDK oriented, or src oriented?)
Thanks, I'll have a look.
Aaah, that seems to have done the trick. I was missing the java-XX-openjdk-devel package...
Hi all,
I am trying to package ansible-rulebook for openSUSE, which has jpy as a transient dependency.
I get an error during build, where jpy complains about JAVA_HOME not being set properly. I set it so it does not point to a link (which seems to cause problems, according to #86). But even now it fails:
I tried different openjdk versions (11, 17, 20) and set JAVA_HOME accordingly. But I get the error each time.
Also, the build runs three times (for python 3.9, 3.10 and 3.11) and all of them fail with the same error.
Any idea what goes wrong there? What am I missing?