java - Building avahi for use in the Oracle jvm (error: jni.h not found) -


this follow following question: compile errors when defining macro convert case class instance map , back

the answer there resolved initial problem -- not installing dependencies. however, have problem because ant clean all still not able find jni.h. possibly because instructions install open jdk 6. there workaround oracle jdk 7. here error i'm getting:

myuser@ubuntu:~/downloads/avahi4j-0.1$ ant clean buildfile: /home/myuser/downloads/avahi4j-0.1/build.xml  clean:      [exec] make: entering directory `/home/myuser/downloads/avahi4j-0.1/src'      [exec] rm -f avahi4j_client.o avahi4j_entrygroup.o avahi4j_avahi4jconstants.o thread-watch.o avahi4j_servicebrowser.o avahi4j_serviceresolver.o avahi4j_recordbrowser.o libavahi4j.so ./*~      [exec] make: leaving directory `/home/myuser/downloads/avahi4j-0.1/src'    [delete] deleting directory /home/myuser/downloads/avahi4j-0.1/classes  init:     [mkdir] created dir: /home/myuser/downloads/avahi4j-0.1/classes  jnilib:      [exec] make: entering directory `/home/myuser/downloads/avahi4j-0.1/src'      [exec] gcc -i. -i/usr/lib/jvm/java-6-sun/include -i/usr/lib/jvm/java-6-sun/include/linux/ -i/usr/include/avahi-common  -o3 -fpic -dver_maj="0" -dver_min="1"   -c -o avahi4j_client.o avahi4j_client.c      [exec] make: leaving directory `/home/myuser/downloads/avahi4j-0.1/src'      [exec] avahi4j_client.c:23:17: fatal error: jni.h: no such file or directory      [exec]  #include <jni.h>      [exec]                  ^      [exec] compilation terminated.      [exec] make: *** [avahi4j_client.o] error 1  build failed /home/myuser/downloads/avahi4j-0.1/build.xml:75: exec returned: 2   total time: 0 seconds 

i found problem. in case, needed make following change src/makefile:

# must jdk, not jre !!!  #jdk_home := /usr/lib/jvm/java-6-sun  jdk_home := /usr/lib/jvm/java-7-oracle  #jdk_home := /usr/lib/j2sdk1.6-sun 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -