'Java on macOS: "cannot open JVM dynamic library" despite the file exists
when starting a java program I get the following error message:
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. Older version of this java program still work.
The developer of this java program wasn´t able to help me with this issue.
I got the same issue before with another jdk, i.e. adoptopenjdk-11.jdk.
So it seems not to be the jdk itself, but the update of the java program.
Wrong format of the dylib ?
Any suggestions what is going wrong and how I can check and cure this ?
I am running on macOS 12.3.1 (Monterey)
Solution 1:[1]
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." -Link here
typically, dylib files should not have problems opening up. Maybe it is the way you are opening it, or the file type is different than what we think? Try and provide more information.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Felos9001 |
