diff --git a/csrc/mmdeploy/apis/java/native/CMakeLists.txt b/csrc/mmdeploy/apis/java/native/CMakeLists.txt index 4d93847d40..aad606d74a 100644 --- a/csrc/mmdeploy/apis/java/native/CMakeLists.txt +++ b/csrc/mmdeploy/apis/java/native/CMakeLists.txt @@ -1,7 +1,11 @@ # Copyright (c) OpenMMLab. All rights reserved. project(mmdeploy_java) -find_package(JNI REQUIRED) +if (NOT ANDROID) + find_package(JNI REQUIRED) +else () + set(JNI_LIBRARIES) +endif() mmdeploy_add_library(${PROJECT_NAME} SHARED EXCLUDE mmdeploy_Classifier.cpp @@ -17,6 +21,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE mmdeploy_load_static(${PROJECT_NAME} MMDeployStaticModules) mmdeploy_load_dynamic(${PROJECT_NAME} MMDeployDynamicModules) + target_link_libraries(${PROJECT_NAME} PRIVATE ${JNI_LIBRARIES} MMDeployLibs) install(TARGETS ${PROJECT_NAME} diff --git a/docs/en/01-how-to-build/android.md b/docs/en/01-how-to-build/android.md index ccc0917fb5..6562a78bbf 100644 --- a/docs/en/01-how-to-build/android.md +++ b/docs/en/01-how-to-build/android.md @@ -91,6 +91,12 @@ make install + + OpenJDK + It is necessary for building Java API.
+ See Java API build for building tutorials. + + diff --git a/docs/zh_cn/01-how-to-build/android.md b/docs/zh_cn/01-how-to-build/android.md index 7f06562f34..09f5dcb05c 100644 --- a/docs/zh_cn/01-how-to-build/android.md +++ b/docs/zh_cn/01-how-to-build/android.md @@ -91,6 +91,12 @@ make install + + OpenJDK + 编译Java API之前需要先准备OpenJDK开发环境
+ 请参考 Java API 编译 进行构建. + +