Justin Lloyd
Justin Lloyd

Reputation: 123

Linux ./configure won't detect java or javac

I'm trying to install a library in Linux that has bindings for Java.
As such, I used apt-get install to get both the java jdk 6 and 7. However, when I run the configure, I keep getting this message and the library doesn't install what it needs for java.

checking which interfaces are enabled... cxx c ocaml java
checking for javac... no
checking for java... no
checking for jar... no
checking for javah... no
configure: WARNING: unable to include <jni.h>

From the command line, both java and javac work. I'm not sure what else to do. Any guidance? Thanks.

Edit: This is on an Ubuntu setup. Not sure where the Debian keyword came from.

Upvotes: 1

Views: 780

Answers (1)

Justin Lloyd
Justin Lloyd

Reputation: 123

Looks like the update-java-alternatives pushed me in the right direction. I tried which java but it only told me: /usr/bin.

I used update-java-alternatives -l and it outputted where the jdk was installed:

/usr/lib/jvm/java-1.6.0-openjdk-amd64
/usr/lib/jvm/java-1.7.0-openjdk-amd64

From there, I could use the command:

./configure --with-java=/usr/lib/jvm/java-1.7.0-openjdk-amd64

It found my jdk after that. Thanks for the help everyone.

Upvotes: 2

Related Questions