我得源文件如下: package vanda.expression;public class JavaExpress{ public native int MathematicCompute (byte[] express,StringBuffer result); public native int BusinessDecision(byte[] businessExpress); public native int CreatDataPool(int HashRecNum); public native int FreeDataPool(); public native int SetVariableToDataPool(byte[] VarName,byte[] VarData,int protect); public native int GetVariableFromDataPool(byte[] VarName,StringBuffer VarData); public native int RemoveLikeVariable(byte[] PreName); public native int RemoveLowerVariable(int Protect); public native int UnloadDataPool(StringBuffer str,int len); public native int ReloadDataPool(byte[] str);
文件名也带着包名,并且.h的函数声明也带着包名
如: 我的包是package jp.co.screen.pia.hfw.util;
.class 文件为DragAndDrop.class
生成的.h为jp_co_screen_pia_hfw_util_DragAndDrop.h.java中的方法public native static void setWindowLong();
在.h中为
JNIEXPORT void JNICALL Java_jp_co_screen_pia_hfw_util_DragAndDrop_setWindowLong
(JNIEnv *, jclass);希望对你有帮助
package vanda.expression;public class JavaExpress{
public native int MathematicCompute (byte[] express,StringBuffer result);
public native int BusinessDecision(byte[] businessExpress);
public native int CreatDataPool(int HashRecNum);
public native int FreeDataPool();
public native int SetVariableToDataPool(byte[] VarName,byte[] VarData,int protect);
public native int GetVariableFromDataPool(byte[] VarName,StringBuffer VarData);
public native int RemoveLikeVariable(byte[] PreName);
public native int RemoveLowerVariable(int Protect);
public native int UnloadDataPool(StringBuffer str,int len);
public native int ReloadDataPool(byte[] str);
}生成的JavaExpress.class文件
使用javah vanda\express\JavaExpress生成.h 文件,生成的文件名为vanda_0005cexpression_0005cJavaExpress.h,为什么?
你使用的java的jdk的版本是什么,我使用Jsdk 1.4.1
如下javah vanda\express\JavaExpress,所以导致生成.h的文件名称不正确。
谢谢!LoveRose(旺旺),结贴了。