Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javah issue Android Ndk in Linux

I am using Ubuntu Linux 32bit system, in terminal it shows no class specified

sanidhya09@sanidhya09:~/workspace/NdkFooActivity$ javah -jni -classpath adt-bundle-linux-x86/sdk/platforms/android-4.2/android.jar;bin/classes/ -d jni/ com.example.NdkFooactivity Error: no classes specified bash: bin/classes/: Is a directory

even i have tried this

sanidhya09@sanidhya09:~/workspace/NdkFooActivity/bin/classes$ javah
-jni -classpath adt-bundle-linux-x86/sdk/platforms/android-4.2/android.jar; com.example.NdkFooactivity.NdkFooActivity Error: no classes specified com.example.NdkFooactivity.NdkFooActivity: command not found

even i tried External tools configuration where in argument section i wrote

-d /home/sanidhya09/workspace/NdkFooActivity/jni -classpath /home/sanidhya09/adt-bundle-linux-x86/sdk/platforms/android-4.2/android.jar:/home/sanidhya09/workspace/NdkFooActivity/bin/classes com.example.NdkFooactivity

even in eclipse i get error saying make:

[HelloJni] Error 127 HelloJni C/C++ Problem

like image 998
Sanidhya Kumar Avatar asked Feb 22 '26 07:02

Sanidhya Kumar


1 Answers

sanidhya09@sanidhya09:~/workspace/NdkFooActivity$ javah -jni -classpath bin/classes:~/adt-bundle-linux-x86/sdk/platforms/android-16/android.jar com.example.NdkFooactivity.NdkFooActivity

should be fine, assuming your app package is com.example.NdkFooactivity and the class you are interested in is NdkFooActivity.

Note that you must pass the path to android.jar you actually used to compile. In my SDK, the directory is called android-16, not android-4.2. Also, you need to have the bin/classes directory in classpath. You may need more jars in your classpath.

like image 63
Alex Cohn Avatar answered Feb 23 '26 20:02

Alex Cohn