0
的Netbeans的基礎教程
我下面這個Netbeans tutorial for JNI但是當我建立我的JNIDemo.c
庫我在NetBeans輸出得到這個錯誤:錯誤以下JNI
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Entering directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
rm -f -r build/Debug
rm -f dist/libJNIDemoCdl.so
make[1]: Leaving directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
CLEAN SUCCESSFUL (total time: 54ms)
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/libJNIDemoCdl.so
make[2]: Entering directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/JNIDemo.o.d"
gcc -shared -m32 -c -g -I/opt/jdk1.7.0_67/include -I/opt/jdk1.7.0_67/include/linux -include /opt/jdk1.7.0_67/include -include /opt/jdk1.7.0_67/include/linux -fPIC -MMD -MP -MF "build/Debug/GNU-Linux-x86/JNIDemo.o.d" -o build/Debug/GNU-Linux-x86/JNIDemo.o JNIDemo.c
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:59:1: fatal error: /opt/jdk1.7.0_67/include: No such file or directory
#endif
^
compilation terminated.
make[2]: *** [build/Debug/GNU-Linux-x86/JNIDemo.o] Error 1
make[2]: Leaving directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/username/Documents/JavaProjects/JNIDemoCd1'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 119ms)
謝謝你們!
你在哪裏安裝了jdk1.7_0_67? – CharlieS
我怎麼知道?我的意思是,根據我的說法,它在/ opt/jdk中。 – onlycparra
根據你發佈的文章,它是/ home/ubuntu。如果你不知道它在哪裏,你爲什麼改變這個?文章清楚地解釋了先決條件。 – CharlieS