CMake无法在新Mac Mini上找到JNI软件包

mrzz3bfm  于 2023-05-22  发布在  Mac
关注(0)|答案(1)|浏览(391)

在新的Mac mini上运行时,CMake无法找到包JNI。cmake配置文件可以在较旧的MacBook Pro、Windows和各种Linux上运行。以下是血淋淋的细节:

cmake version 3.26.3
java version "20.0.1" 2023-04-18
Java(TM) SE Runtime Environment (build 20.0.1+9-29)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)
Darwin  22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:01:02 PST 2023; 
root:xnu-8796.101.5~3/RELEASE_ARM64_T8112 arm64
JAVA_HOME /Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home
ls -l /Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home/include/jni.h
-rw-r--r--  1 root  wheel  74986 Mar  7 09:13 /Library/Java/JavaVirtualMachines/jdk-20.jdk/Contents/Home/include/jni.h
CMake Debug Log at /Applications/CMake.app/Contents/share/cmake-3.26/Modules/FindJNI.cmake:434 (find_path):
  find_path called with the following settings:

    VAR: JAVA_INCLUDE_PATH
    NAMES: "jni.h"
    Documentation: JNI include directory
    Framework
      Only Search Frameworks: 1
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 1
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
    CMAKE_FIND_USE_INSTALL_PREFIX: 1

  find_path considered the following locations:

  The item was not found.

而且,是的,我试过将CMAKE_FIND_FRAMEWORK设置为“never”,但没有效果。

xzlaal3s

xzlaal3s1#

这是CMake的FindJNI模块中的一个bug,该模块依赖于JavaVM框架,而JavaVM框架在XCode 12.2中被删除。
相应的CMake bugticket包含FindJNI模块的补丁,但我还没有测试它是否实际工作。

相关问题