简体   繁体   English

macOS 上的 Java:尽管文件存在,但“无法打开 JVM 动态库”

[英]Java on macOS: "cannot open JVM dynamic library" despite the file exists

when starting a java program I get the following error message:启动 java 程序时,我收到以下错误消息:

Cannot open JVM dynamic library
Dynamic library location: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/lib/libjli.dylib

But the file exists:但文件存在:

-rw-r--r--  1 root  wheel  97616 17 Jan 06:40 /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/lib/libjli.dylib

The issue occured when I updated the java program itself.问题发生在我更新 java 程序本身时。 Older version of this java program still work.这个 java 程序的旧版本仍然有效。 The developer of this java program wasn´t able to help me with this issue.这个 java 程序的开发者无法帮助我解决这个问题。 I got the same issue before with another jdk, ie adoptopenjdk-11.jdk .我之前在使用另一个 jdk 时遇到了同样的问题,即adoptopenjdk-11.jdk So it seems not to be the jdk itself, but the update of the java program.所以好像不是jdk本身的问题,而是java程序的更新。 Wrong format of the dylib? dylib 格式错误?

Any suggestions what is going wrong and how I can check and cure this?任何建议出了什么问题以及我如何检查和解决这个问题?

I am running on macOS 12.3.1 (Monterey)我在 macOS 12.3.1 (Monterey) 上运行

here is what I found online regarding the format of your file,这是我在网上找到的有关文件格式的信息,

"Most DYLIB files are probably dynamic library files, but if you suspect that yours isn't and that it's instead used by a different program for a different purpose, try opening the file in a free text editor. If your specific DYLIB file isn't a dynamic library file, then being able to see the contents of the file as a text document may shed some light on the type of format the file is in, which may help you determine what program should be used to open that particular DYLIB file." “大多数 DYLIB 文件可能是动态库文件,但如果您怀疑您的文件不是动态库文件,并且它被不同的程序用于不同的目的,请尝试在自由文本编辑器中打开该文件。如果您的特定 DYLIB 文件不是t 动态库文件,然后能够将文件内容视为文本文档可能会阐明文件所采用的格式类型,这可能有助于您确定应该使用什么程序打开该特定 DYLIB 文件” - Link here -链接在这里

typically, dylib files should not have problems opening up.通常,dylib 文件打开时应该没有问题。 Maybe it is the way you are opening it, or the file type is different than what we think?也许是你打开它的方式,或者文件类型与我们想象的不同? Try and provide more information.尝试并提供更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM