ThreaderSlash ThreaderSlash - 6 days ago 5
Android Question

ndk-build eclipse argument: not find class

We are developing a system for Android devices. For that we are using FC16, Eclipse, SDK, NDK.

In Eclipse: Run > External tool > External Tolls Configurations > we have the tabs:

[Main]
Location:
/usr/java/jdk1.7.0_02/bin/javah
Working Directory:
${workspace_loc:/MyProject/bin}
Arguments:
-d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity

[Refresh]
Specify Resources
MyProject - JNI


Then when clicking on "Apply" and "Run" it comes the error message:

Error: Could not find class file for 'com.myproject.MyActivity'.


But, on the other hand if we go on terminal into the directory /MyProject and run the command:

ndk-build


No error appears, and the program runs as native C++ on Android.

What is missing on Eclipse IDE? Should be something to do with the [Argment] as informed in [External Tolls Configurations], or is it something else we missed?

All comments and suggestions are welcome and highly appreciated.

Answer

add -classpath it worked for me

-d ${workspace_loc:/MyProject/jni} -classpath ${workspace_loc:/MyProjec/src} com.myproject.MyActivity