3
votes

I am trying to install mod_java on ubuntu.

  1. I have installed the latest java(1.6).
  2. I have configured freeswitch with mod_java module enabled in module.conf.xml

then when i run the make file, it says:

freeswitch_java.h:5:17: error: jni.h: No such file or directory

I have searched through the java installtion folders, but did not find any include folder or jni.h.

Can anyone help, what is being the problem here.

Thanks for reading this question.

4

4 Answers

2
votes

I had the same problem. The solution was to run configure with the option --with-java:

./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/

I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:

make mod_java-install
0
votes

It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.

0
votes

Type this linux command to locate your jni.h file on your filesystem.

locate jni.h

you should be able to get it somewhere in /usr/lib/java directory or some other directory depending upon your java home.

copy paste the jni.h in src/include folder of your freeswitch src. It will throw you some more errors for different .h files just copy all of them to your src/include folder.

0
votes

in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path

mod_java_la_CPPFLAGS

-I/usr/lib/jvm/default-java/include \