Error: Class org.opencv.core.Mat not found.

When I create a header file with JNI using "javah", it shows

Error: Class org.opencv.core.Mat could not be found.

System: Mac OSX

Usage: Android Studio and opencv 3.1 for android

Command line:

javah -classpath /Users/lumeng/Library/Android/sdk/platforms/android-23/android.jar:. com.lumenghz.test.OpencvHelper

Who can help me?

Edit-1 I also tried

javah -d ~/Documents/androidworkspace/RumenTest/test/src/main/jni -classpath /Users/lumeng/Library/Android/sdk/platforms/android-23/android.jar:. com.lumenghz.test.OpencvHelper

But still the same error:

Error: Class org.opencv.core.Mat could not be found.
0
source share
2 answers

Here you indicate the wrong path:

com.lumenghz.test.OpencvHelper

Give the full class path as follows:

~ / Documents / androidworkspace / RumenTest / openCVLibrary310 / build / intermediate / classes / debugging :. com.lumenghz.test.OpencvHelper

  javah -d (JNI Folder Location) -classpath (JAR Locaion);(class Path)

an example according to your ways -

 javah -d ~/Documents/androidworkspace/RumenTest/test/src/main/jni -classpath /Users/lumeng/Library/Android/sdk/platforms/android-23/android.jar;~/Documents/androidworkspace/RumenTest/openCVLibrary310/build/intermediates/classes/debug: com.lumenghz.test.OpencvHelper
+1
source

solvable

I have to declare the path of the opencv-sdk-android class that was created.

, commandLine :

javah -classpath ~/Documents/androidworkspace/RumenTest/openCVLibrary310/build/intermediates/classes/debug:. com.lumenghz.test.OpencvHelper
0

All Articles