Javah error while using it in JNI

前端 未结 14 1693
离开以前
离开以前 2020-12-01 05:27

Command:

javah -jni JavaHowTo

Result:

error: cannot access JavaHowTo 
class file for JavaHowTo not found

javadoc: error -          


        
14条回答
  •  情歌与酒
    2020-12-01 05:46

    I had this problem when I add to -classpath my source directory. I thought classes are in *.java files ;)

    Javah is working on byte code so you have to add directory with your binaries to classpath

    I made some eclipse task:

    "Location"

    ${env_var:JAVA_HOME}\bin\javah.exe
    

    "Arguments"

    -verbose 
    -force
    -classpath ;${project_loc}\bin
    -d ${project_loc}\jni 
    ${java_type_name}
    

    Select file and Run

提交回复
热议问题