jni.h:没有这样的文件或目录 [英] jni.h: No such file or directory

查看:1154
本文介绍了jni.h:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在关注本教程,在第5步,我从GCC获取以下输出:

I have been following this tutorial, and at step 5, I am getting the following output from GCC:

    HelloWorld.c:1:17: error: jni.h: No such file or directory
    In file included from HelloWorld.c:3:
    HelloWorld.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
    HelloWorld.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’



我知道他包含的目录因系统而异,以适应命令相应,但我似乎无法找到我的系统上正确的目录。我使用的是Ubuntu 10.04LTS。

I know that he include directories vary from system to system, so I tried to adapt the command accordingly, but I cannot seem to find the correct directory on my system. I am using Ubuntu 10.04LTS.

推荐答案

打开一个终端并输入:

locate jni.h

其中每个文件称为jni.h在您的系统上。我在ubuntu 11.04,它位于:

That should tell you where every file called jni.h is on your system. I am on ubuntu 11.04, and it's located at:

/usr/lib/jvm/java-6-openjdk/include/jni.h
/usr/lib/jvm/java-6-sun-1.6.0.26/include/jni.h

您可能还需要从仓库中获取它:

You may also need to get it from the repos:

sudo apt-get install openjdk-6-jdk 

如果你没有安装它,应该做的。

should do the trick if you don't have it installed.

这篇关于jni.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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