如何找到jni.h? [英] how to make jni.h be found?

查看:1299
本文介绍了如何找到jni.h?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ubuntu 12.04中,我安装了sun / oracle的jdk7。当找到jni.h 时,它会打印多个位置

In Ubuntu 12.04, I have jdk7 from sun/oracle installed. When locate jni.h, it prints multiple locations

/usr/lib/jvm/java-6-openjdk-amd64/include/jni.h
/usr/lib/jvm/jdk1.7.0_07/include/jni.h
...

在JDK生成的头文件中,有 include< jni.h> ,目前它抱怨

In the header file generated by JDK, there is include <jni.h>, and currently it complains

fatal error: jni.h: No such file or directory.

在我的 Makefile 中,没有规范 jni.h 的地点是。我问是否有可能配置某些系统参数来创建 jni.h 的路径(例如, /usr/lib/jvm/jdk1.7.0 _07 / include / jni.h )在编译时要知道。

In my Makefile, there is no specification of locations where jni.h is. And I am asking if possible to configure certain system parameter to make path of jni.h (say, /usr/lib/jvm/jdk1.7.0_07/include/jni.h) to be known when being compiled.

推荐答案

你必须告诉你的编译器include目录在哪里。这样的事情:

You have to tell your compiler where is the include directory. Something like this:

gcc -I/usr/lib/jvm/jdk1.7.0_07/include

但这取决于你的makefile。

But it depends on your makefile.

这篇关于如何找到jni.h?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆