Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

C#
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");
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900