Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jni headers not found #516

Closed
kentergav opened this issue Sep 22, 2021 · 1 comment
Closed

jni headers not found #516

kentergav opened this issue Sep 22, 2021 · 1 comment

Comments

@kentergav
Copy link

Running current release on MacOS. I want to get java interface but ./configure showed jni headers not found and skipped build java interface.

checking for javac... javac
checking if javac works... yes
checking if javac supports -h... yes
checking for javac... /usr/bin/javac
checking jni headers... none
configure: No JNI header directory. Disabling build of Java interface.
checking whether the linear solver loader should be used... yes
checking for dlopen in -ldl... yes

I confirmed that jni.h in the path /Users/bill/Library/Java/JavaVirtualMachines/openjdk-16.0.2/Contents/Home/include and tried to add CPPFLAGS in ./configure

./configure CPPFLAGS=-I/Users/bill/Library/Java/JavaVirtualMachines/openjdk-16.0.2/Contents/Home/include

but still get the same error and skipped java interface building

@svigerske
Copy link
Member

svigerske commented Oct 4, 2021

I have some faint memory of problems with the Java macros on recent macOS versions because of the version number changing from 10.x to 11.y. It's probably mentioned somewhere in the autoconf-archive bugtracking system.

The line

Ipopt/configure

Line 26122 in d872b3a

macos_version=$(sw_vers -productVersion | sed -n -e 's/^[0-9]*.\([0-9]*\).[0-9]*/\1/p')

gives macos_version=0 on macOS 11.0.z, so that it goes into the wrong branch in the following if. Try hardcoding macos_version=11 at this line and see if that helps.

configure only checks here for the presence of jni.h in some locations relative to the Java installation, but doesn't use compiler search paths as you would influence with CPPFLAGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants