“无法加载javah"Eclipse 中的错误 [英] "Can't load javah" error in Eclipse

查看:15
本文介绍了“无法加载javah"Eclipse 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 Eclipse 的 ant 构建文件中使用 javah 任务,但不断收到以下错误:

I am trying to use the javah task in an ant build file in Eclipse and I keep getting the following error:

构建失败

C:\sandbox\build-jni.xml:7: 无法加载 javah

C:\sandbox\build-jni.xml:7: Can't load javah

这是我的 build-jni.xml 文件:

Here is my build-jni.xml file:

<project>
<property name="bin" location="bin" />


<target name="generate-jni">
    <javah destdir="${bin}" classpath="${bin}">

        <class name="org.example.ExecJNI" />
    </javah>
</target>

有没有想过为什么我会收到这个错误?我的项目指向 JDK 而不是 JRE

Any thoughts as to why I'm getting that error? My project is pointing to the JDK and not the JRE

推荐答案

原来我的 Ant Home Entries in Window 中没有 C:\Program Files\Java\jdk1.7.0_15\tools.jar -->喜好.这似乎解决了问题.

Turned out I didn't have C:\Program Files\Java\jdk1.7.0_15\tools.jar in my Ant Home Entries in Window --> Preferences. That seemed to fix the problem.

这篇关于“无法加载javah"Eclipse 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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