日期:2014-05-20  浏览次数:20677 次

javah的问题
d:\TestNativeCode> javah   cn.hallon.testNative
错误报告:

错误:无法访问   testNative
未找到   testNative   的类文件
javadoc:   错误   -   找不到类   testNative。
Error:   未在命令行中指定任何类。请尝试使用   -help。

代码:

package   cn.hallon;

public   class   testNative   {

public   native   void   sayHello();
/**
  *   @param   args
  */
public   static   void   main(String[]   args)   {
//   TODO   Auto-generated   method   stub

}

}



------解决方案--------------------
先javac -d . testNative.java
再javah cn.hallon.testNative
------解决方案--------------------
java cn.hallon.testNative
------解决方案--------------------
文件名与类名一致吗?
------解决方案--------------------
classpath