configure: error: *** Cannot find jni.h - check your JDK installation ***
-
Having a tough time figuring out how to get configure to see my JDK install. Tried below with --includedir=/usr/lib/jvm/java-8-oracle as well.
Edit: This is trying to build netxms-2.0-RC2 on Ubuntu 12.04.5 with Oracle's Java SDK version 1.8 installed.sh ./configure --prefix=/opt/netxms --with-server --with-snmp --with-client --with-client-proxy --with-agent --disable-ipv6 --with-jdk --with-mysql --with-openssl --with-gnu-ld
...
configure: error: *** Cannot find jni.h - check your JDK installation ***java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/lib/jvm/java-8-oracle/include
JAVA_HOME=/usr/lib/jvm/java-8-oracle
J2SDKDIR=/usr/lib/jvm/java-8-oracle
J2REDIR=/usr/lib/jvm/java-8-oracle/jreUPDATE/SOLVE:
On a hunch that configure needs gcj glue to "find" java headers, went ahead and installed java-gcj-compat-headless and java-gcj-compat-dev and all dependencies. Configure works now. -
Hi,
alternatively, you can specify JDK location in --with-jdk parameter, like this:
./configure --with-jdk=/usr/lib/jvm/java-7-openjdk-amd64
JDK location varies between distributions, this example is from Deian/Ubuntu.
Best regards,
Victor -
Hi, Victor.
Actually I tried specifying with --with-jdk /usr/lib/jvm/java-8-oracle and also appending /include to path - neither worked. Don't know if it's a limitation of the configure function to check java version but installing the gjc packages did the trick.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login