Javah错误无法用于“com.example.I2CInterafce”的类文件 [英] Javah Error Couldnt class file for "com.example.I2CInterafce"

查看:94
本文介绍了Javah错误无法用于“com.example.I2CInterafce”的类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索解决方案3天仍然无法找到。



我的java文件正常工作,没有错误。我将我的java文件I2CInterface.java复制到jdk / bin目录。然后javac I2CInterface.java成功创建了I2CInterface.class。但是javah -jni I2CInterface给出错误类无法找到。头文件无法创建。

我设置了我的环境并添加了路径C:\Program Files\Java\jdk1.8.0\bin。

这很有趣javah在某些类上工作,它可以创建头。但是在这堂课上,有些班级不行。



我的java文件如下。



I search for solution 3 day still I cant find.

My java file work normally and no error. I copied my java file "I2CInterface.java" to "jdk/bin" directory. Then "javac I2CInterface.java" the I2CInterface.class created succesfully. But "javah -jni I2CInterface" give error class couldnt found. The header file cant created.
I set my environtmental and add path C:\Program Files\Java\jdk1.8.0\bin.
That is interesting javah work on some class and it can create header. But on this class and some class not work.

My java file below.

public class I2CInterface {

private static native int i2cwrite(byte[] data);
private static native byte[] i2cread(int data_len);

public static int write(byte[] data) {
    return(i2cwrite(data));
}
public static byte[] read(int data_len) {
    return(i2cread(data_len));
}

static
{
    System.loadLibrary("i2cinterface");
}

推荐答案

这篇关于Javah错误无法用于“com.example.I2CInterafce”的类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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