正在构建用于Oracle jvm的avahi(错误:jni.h未找到)
Building avahi for use in the Oracle jvm (error: jni.h not found)
这是以下问题的后续:定义宏将case类实例转换为映射并返回时的编译错误
那里的答案解决了我最初的问题——我没有安装依赖项。但是,现在我有一个问题,因为ant clean all
仍然无法找到jni.h
。这可能是因为说明说要安装打开的jdk 6。是否有解决Oracle jdk 7的方法?下面是我得到的错误:
myUser@ubuntu:~/Downloads/avahi4j-0.1$ ant clean all
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
我找到问题了。在我的情况下,我需要对src/Makefile
进行以下更改:
# It must be a JDK, not a JRE !!!
#JDK_HOME := /usr/lib/jvm/java-6-sun
JDK_HOME := /usr/lib/jvm/java-7-oracle
#JDK_HOME := /usr/lib/j2sdk1.6-sun
相关文章:
- JNI 在应用程序中检测到错误:在为 innerclass 调用 NewObject 时使用了无效的 jobject
- 使用本机 JNI 静态方法实现C++ Java 运行时错误
- 有时只得到 jni segv_accer或segv_mapper错误
- Android (ART) 崩溃并显示错误 JNI 在应用程序中检测到错误:jstring 是无效的本地引用
- JNI 不满意链接错误: 动态链接库 (DLL) 初始化例程失败
- C++ JNI 不满意的链接错误
- Java JNI GDAL 本机库在重新部署为 Web 应用程序时出现类加载器错误
- 任何人都可以在带有JNI的Android Studio上帮助我解决此错误,是否缺少一些内容?
- 在 JNI 中使用错误的代码将 jbytearray 转换为 char*
- Android JNI 未定义对错误 c++ 方法的引用
- JNI - WMI 连接错误
- JNI 代码返回字符串,但得到错误 java.lang.UnsatisfiedLinkError: com.packag
- 在创建新对象时,尝试将参数提供给JNI对象的构造函数时会出现错误
- JNI检测到应用程序中的错误:使用已删除的弱全局参考
- 从WordCount Hadoop示例调用Helloworld Jni函数,给出错误Java.lang.unsatisf
- vc++JNI错误LNK2019:未解析的外部符号
- Opencv将Mat从Android传递到JNI错误
- 构建时JNI错误
- Android JNI错误:调用带有布尔参数的函数会导致崩溃
- 一个JNI错误出现在quick cocos中