一个很简单的例子,
public class TestDll
{
static {
System.loadLibrary("BestMail");//这个我放在系统目录system32下,一个dll文件
}
//private int m;
public native void set(int i);
public native int get();
/**
* @param args
*/
public static void main(String[] args)
{
// TODO 自动生成方法存根
TestDll td=new TestDll();
td.set(10);
System.out.println("hahah "+td.get());
}}然后我javac这个文件,通过,然后javah -jni testdll时报错如下,
E:\Eclipse\eclipse\workspace\TestDll>javah -jni TestDll
error: cannot access TestDll
file TestDll.class not found
javadoc: error - Class TestDll not found.
Error: No classes were specified on the command line. Try -help.为什么啊?????谢谢。
public class TestDll
{
static {
System.loadLibrary("BestMail");//这个我放在系统目录system32下,一个dll文件
}
//private int m;
public native void set(int i);
public native int get();
/**
* @param args
*/
public static void main(String[] args)
{
// TODO 自动生成方法存根
TestDll td=new TestDll();
td.set(10);
System.out.println("hahah "+td.get());
}}然后我javac这个文件,通过,然后javah -jni testdll时报错如下,
E:\Eclipse\eclipse\workspace\TestDll>javah -jni TestDll
error: cannot access TestDll
file TestDll.class not found
javadoc: error - Class TestDll not found.
Error: No classes were specified on the command line. Try -help.为什么啊?????谢谢。
是不是这个文件"BestMail"缺省后缀名?