致命错误:jni.h:安装jPype时没有此类文件或目录 [英] Fatal error: jni.h: No such file or directory while installing jPype
问题描述
我正在尝试在Ubuntu 13.04上安装JPype.我已经安装了Oracle Java 1.7.但是,当我这样做时,会出现以下错误:
I am trying to install JPype on Ubuntu 13.04. I have Oracle Java 1.7 installed. But when I do so, I get the following error:
src/native/common/include/jpype.h:45:17: fatal error: jni.h: No such file or directory
与很多关于stackoverflow的类似问题不同,该文件不在我的系统中,即
Unlike a lot of similar questions on stackoverflow, the file isn't present on my system i.e.
locate jni.h
不返回任何内容.是的,在发出上述命令之前,我已经运行过sudo Updatedb.
returns nothing. Yes, I have run sudo updatedb before issuing above command.
推荐答案
您已经安装了JRE而不是JDK.
You have installed a JRE and not a JDK.
要编译JNI本机代码,您需要安装JDK,该JDK带有适当的jni.h标头以及特定于操作系统的标头.
To compile JNI native code, you need to install a JDK, which comes with the appropriate jni.h header, as well as the OS specific headers.
执行此操作时,将包含路径更新为
When you do that, update your include path to
-I <path_to_jdk>/include -I <path_to_jdk>/include/linux
这篇关于致命错误:jni.h:安装jPype时没有此类文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!