无法打开包含文件“jni.h”,不存在这样的文件或目录
我正在实现简单的 JNI 示例,如
http://java 中给出的.sun.com/docs/books/jni/html/start.html
在最后一步,当编译 C 源代码时,
使用以下命令:
C:\Program Files\Java\jdk1.6.0_21> cl -IC:\Program Files\Java\jdk1.6.0_21\include -IC:\Program Files\Java\jdl1.6.0_21\include\win32 -MD -LD Callbacks.c -FeCallbacks.dll
我收到以下错误:
“无法打开包含文件“jni.h”,不存在这样的文件或目录。”
但是jni.h
确实存在于java/jdk1.6.0_21/include文件夹中。
我怎样才能消除这个错误?
I am implementing the simple JNI example , as given in
http://java.sun.com/docs/books/jni/html/start.html
At the second last step, when the C source is being compiled,
the following command is used:
C:\Program Files\Java\jdk1.6.0_21> cl -IC:\Program Files\Java\jdk1.6.0_21\include -IC:\Program Files\Java\jdl1.6.0_21\include\win32 -MD -LD Callbacks.c -FeCallbacks.dll
I get the following error:
"Cannot open include file "jni.h", No such file or directory exists."
But jni.h
does exist in java/jdk1.6.0_21/include folder.
How can I remove this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于路径包含空格,因此您需要将路径括在“”内,例如
cl -IC:\Program Files\Java\jdk1.6.0_21\includ e -I"C:\Program Files\Java\jdl1.6.0_21\include\win32" -MD -LD Callbacks.c -FeCallb acks.dll
Since the path contain spaces u need to enclose the path inside "" like
cl -IC:\Program Files\Java\jdk1.6.0_21\includ e -I"C:\Program Files\Java\jdl1.6.0_21\include\win32" -MD -LD Callbacks.c -FeCallb acks.dll
如果路径包含空格,则必须引用该路径。就我而言,命令如下:
希望有帮助。
If the path contains spaces then you must have to quote the path . In my case the command is as follows :
Hope it helps .