我试图通过导入jpype在 python 脚本中使用 java 类,但是,每次我这样做时,执行都会崩溃。我在 macOS 上使用 python3 运行脚本,JVM 是 zulu-8.jdk。
这是脚本
import jpype as jp
jp.startJVM(jp.getDefaultJVMPath(), "-ea")
jp.java.lang.System.out.println("hello world")
jp.shutdownJVM()
我收到的崩溃消息是OpenJDK 64 位服务器 VM 警告:尝试保护堆栈保护页面失败。zsh:杀死python3 test.py
谢谢您的帮助 !