I am trying to create a header file using javah tool from command line on windows 7 OS but i am failing all the time.
I have followed different ways and even read t
If you are using eclipse: append -classpath PATH_OF_PACKAGE_TOP into javah CLASSNAME
Example:javah -classpath . com.byf.test.JNI
my tree : `
.
├── com
│ └── byf
│ └── test
│ └── JNI.java
└── libcall.so`
result:`
byf@byf-Ubuntu:~/code/workspace_eclipse_java/JAVA_YF/src$ javah -classpath . com.byf.test.JNI
byf@byf-Ubuntu:~/code/workspace_eclipse_java/JAVA_YF/src$ ls
com com_byf_test_JNI.h libcall.so
byf@byf-Ubuntu:~/code/workspace_eclipse_java/JAVA_YF/src$ cat com_byf_test_JNI.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include
/* Header for class com_byf_test_JNI */
#ifndef _Included_com_byf_test_JNI
#define _Included_com_byf_test_JNI
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_byf_test_JNI
* Method: add
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_com_byf_test_JNI_add
(JNIEnv *, jclass, jint, jint);
#ifdef __cplusplus
}
#endif
#endif
`