android - javah doesn't find my class

前端 未结 3 989
忘了有多久
忘了有多久 2020-12-05 19:38

I am having troubles generating the C header file for JNI using javah.

Here\'s the script I use while standing in the \\bin

3条回答
  •  天涯浪人
    2020-12-05 20:28

    You should change the directory to \bin\classes; then, run the following command:

    javah -classpath C:\PROGRA~2\Android\android-sdk\platforms\android-8\android.jar;. com.test.JniTest
    


    I'm using the following command file to generate headers: jHdr.cmd on my desktop:

    @echo on
    SET PLATFORM=android-8
    SET ANDROID_SDK_ROOT=C:\Android\android-sdk
    SET PRJ_DIR=D:\Workspaces\sqLite\raSQLite
    SET CLASS_PKG_PREFIX=ra.sqlite
    cd %PRJ_DIR%\bin\classes
    javah -classpath %ANDROID_SDK_ROOT%\platforms\%PLATFORM%\android.jar;.  %CLASS_PKG_PREFIX%.%~n1
    pause
    


    adjust variables to your needs ...
    put this file on your desktop, then drag you .java file from eclise to jHdr.cmd, result is under %PRJ_DIR%\bin\classes directory

提交回复
热议问题