我试图在Ubuntu 12.04.5 LTS上构建stanford NLP的python界面。 有需要两个步骤,第一个是:在的3rdParty/jpype运行“耙设置”Stanford CoreNLP python界面安装错误
- 编译Jpype
在这样做时,我得到以下错误:
In file included from src/native/common/jp_monitor.cpp:17:0:
src/native/common/include/jpype.h:45:17: fatal error: jni.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
rake aborted!
Command failed with status (1): [cd JPype-0.5.4.1 && python setup.py build...]
错误消息说我缺少jni.h
,所以建议here如果我运行命令dpkg-query -L openjdk-7-jdk | grep "jni.h"
得到/usr/lib/jvm/java-7-openjdk-amd64/include/jni.h
。
我相信这意味着我的系统上有jni.h
,所以我现在很困惑。什么导致了错误?你能提出任何解决办法吗?
感谢您的帮助!
几个洞察
这里是指令导致错误:
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include/linux -Isrc/native/common/include -Isrc/native/python/include -I/usr/include/python2.7 -c src/native/common/jp_class.cpp -o build/temp.linux-x86_64-2.7/src/native/common/jp_class.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
In file included from src/native/common/jp_class.cpp:17:0:src/native/common/include/jpype.h:45:17: fatal error: jni.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
它从所需Python接口的JPype
编译到来。我不知道为什么,但它包含我的文件系统中没有的路径(即-I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include/linux
)。
如何正确配置这些路径?
非常感谢你的答案在哪里!这正是问题所在,唯一的问题是我不知道如何解决问题;)尽管现在管理! – Matteo 2014-11-07 17:44:00