0

I am using Ubuntu14.04, Eclipse Luna.

I am referring Hello World Example given link

http://www.ntu.edu.sg/home/ehchua/programming/android/Android_NDK.html

My project name is HelloNDK.

My project path is /home/androiddev/workspace_luna/HelloNDK

In AndroidManifest.xml I can see package which I use is named as: com.delta.hellondk

Android.jar which automatically added in project which is under Android 5.0.1 & its location shown as

/home/androiddev/Applications/Android_sdk/sdk/platforms/android-21/android.jar

When I use javah command, I got error.

I use following line in terminal.

javah -jni -classpath /home/androiddev/workspace_luna/HelloNDK/bin/classes/;/home/androiddev/Applications/Android_sdk/sdk/platforms/android-21/android.jar -o HelloJNI.h com.delta.hellondk

&

javah -jni -classpath /home/androiddev/workspace_luna/HelloNDK/bin/classes/JNIActivity.class;/home/androiddev/Applications/Android_sdk/sdk/platforms/android-21/android.jar -o HelloJNI.h com.delta.hellondk

when I use following command, I got error as follows:

Error: No classes were specified on the command line.  Try -help.
bash: /home/androiddev/Applications/Android_sdk/sdk/platforms/android-21/android.jar: cannot execute binary file: Exec format error

Now I search lots of keywords in google, stackoverflow regarding how to generate HelloJNI.h automatically. But i failed. Please guide me! I know its repeate question should be get negative vote, should be 'On Hold'. But then also i doesn’t get any clue so i asked without hesitate.

trooper
  • 4,444
  • 5
  • 32
  • 32
Mandar Khire
  • 49
  • 2
  • 10
  • Did u do a build? Where is com.delta.hellondk.class file located? Cd to its parent dir, invoking your expression without the CP part. – Robert Rowntree Dec 24 '14 at 07:03
  • Yes, i used 'clean build' in eclipse so at location /home/androiddev/workspace_luna/HelloNDK/bin/classes/ i can see few .class files generated. I doesnt understand line " invoking your expression without the CP part." – Mandar Khire Dec 24 '14 at 07:14
  • .class file location is /home/androiddev/workspace_luna/HelloNDK/bin/classes/com/delta/hellondk in this i have BuildConfig.class ,R$attr.class,R$dimen.class,R$layout.class,R$string.class,JNIActivity.class,R.class,R$drawable.class,R$menu.class all files generated by eclipse. – Mandar Khire Dec 24 '14 at 07:24
  • Cp=class path. U don't need it if u CD to bin/classes – Robert Rowntree Dec 24 '14 at 13:20
  • I tried lots of possibilities with help of stackoveflow,google. but didn’t succeed. Each time i get same error which i mentioned. Need Help. – Mandar Khire Dec 25 '14 at 06:35
  • I had a same problem, but I found the answer! Add 2 paths in classpath. 1. (android-sdk-path)/extras/android/support/v7/appcompat/libs/android-support-v4.jar 2. (android-sdk-path)/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar – Sohyun Ahn Dec 30 '14 at 07:22

0 Answers0