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

configure: error: cannot find JDK header files #134

Open
jackckoch opened this issue Feb 1, 2019 · 3 comments
Open

configure: error: cannot find JDK header files #134

jackckoch opened this issue Feb 1, 2019 · 3 comments

Comments

@jackckoch
Copy link

jackckoch commented Feb 1, 2019

I am trying to install beagle so that I can install MrBayes on my mac. When I run './configure' I get the following error:
checking if javac works... yes
checking for javac... /usr/bin/javac
checking symlink for /usr/bin/javac... /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
checking for /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h... no
checking for /System/Library/Frameworks/JavaVM.framework/Versions/include/jni.h... no
configure: error: cannot find JDK header files

I have found /jni.h in: /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/include

There is no directory for /Headers or /include in the JavaVM.frameworks/Versions/Current or JavaVM.frameworks/Versions/ where the configure is looking. I cannot make these directories there, so I cannot copy the /jni.h file that I found there.

Any ideas?

@kusalananda
Copy link

kusalananda commented Feb 5, 2019

When compiling Beagle for MrBayes, you don't need JDK (MrBayes does not use the Java Beagle library). Just configure Beagle with --without-jdk.

@kusalananda
Copy link

We (the MrBayes devs) have also noticed that we have to use ./configure LDFLAGS=-Wl,-rpath=prefix/lib when we configure the Beagle libraries on some Unix systems (where prefix is the installation prefix, for example /usr/local). Otherwise Beagle won't find its plugin libraries.

@J-Moravec
Copy link

The other solution would be to set your JAVA_HOME environment variable by putting:
export JAVA_HOME=$(/usr/libexec/java_home) into your .profile
see:
https://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/

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

3 participants