Fatal error: jni.h: No such file or directory while installing jPype

坚强是说给别人听的谎言 提交于 2019-12-13 04:37:50

问题


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

Unlike a lot of similar questions on stackoverflow, the file isn't present on my system i.e.

locate jni.h

returns nothing. Yes, I have run sudo updatedb before issuing above command.


回答1:


You have installed a JRE and not a JDK.

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




回答2:


In fact, this is the correct package to be installed!

$ sudo aptitude install openjdk-7-source
$ sudo updatedb
$ locate jni.h
$ /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h


来源:https://stackoverflow.com/questions/19977970/fatal-error-jni-h-no-such-file-or-directory-while-installing-jpype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!