更新时间:2023-12-03 22:57:22
您可以手动修改 FindJNI.cmake 以帮助它找到您安装的 JDK.请参阅此要点:
You can manually modify FindJNI.cmake to help it find your installed JDK. See this gist:
https://gist.github.com/emchristiansen/6845954
很遗憾这个脚本没有更新,但也许并不奇怪,因为 CMake 是一场灾难.
It's a shame this script hasn't been updated, but maybe not a surprise, given that CMake is such a disaster.
更直接的解决方案是正确设置 JAVA_HOME
.安装 OpenJDK 7 后,我将其设置为:
A more straightforward solution is to set JAVA_HOME
properly.
With OpenJDK 7 installed, I set it with:
导出JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64