android - 错误:找不到类org.opencv.core.Mat

标签 android opencv java-native-interface javah

当我使用“javah”与JNI生成头文件时,它显示

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

系统:Mac OSX

使用:Android Studio和适用于Android的opencv 3.1

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

谁能帮我?

编辑1
我也试过
javah -d ~/Documents/androidworkspace/RumenTest/test/src/main/jni -classpath /Users/lumeng/Library/Android/sdk/platforms/android-23/android.jar:. com.lumenghz.test.OpencvHelper

但是仍然出现相同的错误:
Error: Class org.opencv.core.Mat could not be found.

最佳答案

您在这里给出了错误的类(class)路径:

com.lumenghz.test.OpencvHelper



给出完整的类路径,如下所示:

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


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

根据您的路径示例
 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

关于android - 错误:找不到类org.opencv.core.Mat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39261963/

相关文章:

java - 设置嵌套的 TextView 文本

c++ - Opencv 编解码器选择对话框未显示

java - 在android中使用opencv检测玩具车后面

python - cv2导入错误: DLL load failed: The specified module could not be found

android - 更改 ListView 中的 Textview 大小运行时

java - 在 Android 设备上运行 scala 代码

java - 奇怪的 IF-ELSE 行为 : IF-ELSE both loop executing

android - 如何在你的android项目中加载另一个.so文件?

以编程方式设置 Java.library.path

java - 为什么我需要释放在 JNI native 函数中创建的全局引用?