2

在运行 python 脚本时,我遇到了这个错误,指出找不到 DLL (libjli.dylib),但它存在。

我在 MacOS Big Sur 版本上运行:11.5.2 (Apple M1)。

OSError: [Errno 0] JVM DLL not found: /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home/jre/lib/jli/libjli.dylib

这是目录上的 ls :

% ls -l
total 152
-rwxr-xr-x  1 root  wheel  76832 Jun  9 08:56 libjli.dylib

其他可能的相关信息:

% java --version
openjdk 17 2021-09-14
OpenJDK Runtime Environment Homebrew (build 17+0)
OpenJDK 64-Bit Server VM Homebrew (build 17+0, mixed mode)
% echo $PATH
/opt/homebrew/opt/openjdk/bin:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/opt/homebrew/opt/curl/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin://Users/lewg/local:/opt/homebrew/bin:/Users/lewg/Library/Python/3.8/bin

% pwd
/opt/homebrew/opt/openjdk/bin
% ls -l
total 0
lrwxr-xr-x  1 lewg  admin  44 Jul 14 08:00 jar -> ../libexec/openjdk.jdk/Contents/Home/bin/jar
lrwxr-xr-x  1 lewg  admin  50 Jul 14 08:00 jarsigner -> ../libexec/openjdk.jdk/Contents/Home/bin/jarsigner
lrwxr-xr-x  1 lewg  admin  45 Jul 14 08:00 java -> ../libexec/openjdk.jdk/Contents/Home/bin/java
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 javac -> ../libexec/openjdk.jdk/Contents/Home/bin/javac
lrwxr-xr-x  1 lewg  admin  48 Jul 14 08:00 javadoc -> ../libexec/openjdk.jdk/Contents/Home/bin/javadoc
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 javap -> ../libexec/openjdk.jdk/Contents/Home/bin/javap
lrwxr-xr-x  1 lewg  admin  45 Jul 14 08:00 jcmd -> ../libexec/openjdk.jdk/Contents/Home/bin/jcmd
lrwxr-xr-x  1 lewg  admin  49 Jul 14 08:00 jconsole -> ../libexec/openjdk.jdk/Contents/Home/bin/jconsole
lrwxr-xr-x  1 lewg  admin  44 Jul 14 08:00 jdb -> ../libexec/openjdk.jdk/Contents/Home/bin/jdb
lrwxr-xr-x  1 lewg  admin  50 Jul 14 08:00 jdeprscan -> ../libexec/openjdk.jdk/Contents/Home/bin/jdeprscan
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 jdeps -> ../libexec/openjdk.jdk/Contents/Home/bin/jdeps
lrwxr-xr-x  1 lewg  admin  44 Jul 14 08:00 jfr -> ../libexec/openjdk.jdk/Contents/Home/bin/jfr
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 jhsdb -> ../libexec/openjdk.jdk/Contents/Home/bin/jhsdb
lrwxr-xr-x  1 lewg  admin  47 Jul 14 08:00 jimage -> ../libexec/openjdk.jdk/Contents/Home/bin/jimage
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 jinfo -> ../libexec/openjdk.jdk/Contents/Home/bin/jinfo
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 jlink -> ../libexec/openjdk.jdk/Contents/Home/bin/jlink
lrwxr-xr-x  1 lewg  admin  45 Jul 14 08:00 jmap -> ../libexec/openjdk.jdk/Contents/Home/bin/jmap
lrwxr-xr-x  1 lewg  admin  45 Jul 14 08:00 jmod -> ../libexec/openjdk.jdk/Contents/Home/bin/jmod
lrwxr-xr-x  1 lewg  admin  49 Jul 14 08:00 jpackage -> ../libexec/openjdk.jdk/Contents/Home/bin/jpackage
lrwxr-xr-x  1 lewg  admin  44 Jul 14 08:00 jps -> ../libexec/openjdk.jdk/Contents/Home/bin/jps
lrwxr-xr-x  1 lewg  admin  51 Jul 14 08:00 jrunscript -> ../libexec/openjdk.jdk/Contents/Home/bin/jrunscript
lrwxr-xr-x  1 lewg  admin  47 Jul 14 08:00 jshell -> ../libexec/openjdk.jdk/Contents/Home/bin/jshell
lrwxr-xr-x  1 lewg  admin  47 Jul 14 08:00 jstack -> ../libexec/openjdk.jdk/Contents/Home/bin/jstack
lrwxr-xr-x  1 lewg  admin  46 Jul 14 08:00 jstat -> ../libexec/openjdk.jdk/Contents/Home/bin/jstat
lrwxr-xr-x  1 lewg  admin  47 Jul 14 08:00 jstatd -> ../libexec/openjdk.jdk/Contents/Home/bin/jstatd
lrwxr-xr-x  1 lewg  admin  48 Jul 14 08:00 keytool -> ../libexec/openjdk.jdk/Contents/Home/bin/keytool
lrwxr-xr-x  1 lewg  admin  52 Jul 14 08:00 rmiregistry -> ../libexec/openjdk.jdk/Contents/Home/bin/rmiregistry
lrwxr-xr-x  1 lewg  admin  50 Jul 14 08:00 serialver -> ../libexec/openjdk.jdk/Contents/Home/bin/serialver
4

0 回答 0