在 M1 MacBook 上运行 TypeDB 时出现 UnsatisfiedLinkError
我尝试使用 ./typedb server
在我的 M1 MacBook 上运行 TypeDB,但它会导致以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/5v/95_mbj013y93vsmc8xps0stm0000gp/T/librocksdbjni8182124459810412816.jnilib
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
此错误看起来可能在使用不兼容的 JDK 运行 Java 程序时发生。我可以做什么来解决它?
(免责声明 - TypeDB 维护者。)
I tried running TypeDB on my M1 MacBook using ./typedb server
, but it results in the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/5v/95_mbj013y93vsmc8xps0stm0000gp/T/librocksdbjni8182124459810412816.jnilib
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
This error looks like it might occur when running a Java program with an incompatible JDK. What can I do to resolve it?
(Disclaimer - TypeDB maintainer here.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
TypeDB v2.19 或更高版本
从 TypeDB 2.19.0 开始,TypeDB 支持本机 Mac 和 Linux
arm
架构。只需安装本机 Java 运行时即可运行 TypeDB。旧版本的 TypeDB
如果运行的 JDK 目标为
aarch64
(ARM)(M1 Mac 使用的架构),则启动时会抛出UnsatisfiedLinkError
。 TypeDB例如,要安装 Eclipse Temurin(基于 OpenJDK):
JDK 11
的.pkg
发行版系统MacOS
和体系结构x64
java --version
验证 Java 是否已正确安装;输出应与下载的 JDK 版本匹配请注意,此方法依赖于 MacOS 的 Rosetta 翻译,这会造成性能开销。
TypeDB v2.19 or above
As of TypeDB 2.19.0, TypeDB supports native Mac and Linux
arm
architectures. Simply install a native Java runtime to run TypeDB.Old versions of TypeDB
If the running JDK targets
aarch64
(ARM), the architecture used by an M1 Mac, then anUnsatisfiedLinkError
is thrown at startup. There is no native ARM build of TypeDB <v2.19, so in order for older versions of TypeDB to run correctly on an M1 MacBook you need to ensure that a JDK that targetsx64
architecture is installed.For example, to install Eclipse Temurin (based upon OpenJDK):
.pkg
distribution ofJDK 11
with operating systemMacOS
and architecturex64
java --version
; the output should match the downloaded JDK versionPlease note that this method relies on MacOS's Rosetta translation, which will inflict a performance overhead.
我的电脑是MacBookAir M1。我也遇到了这个问题。
我尝试了Java 17和Java 8,都被归档了。最后,当我切换到 Java 11 时,错误消失了。希望这会有所帮助。
My computer is MacBookAir M1. And I encountered this problem too.
I tried Java 17 and Java 8, and both were filed. Finally, when I switch to Java 11, the error disappeared. Hope this helps.
从 TypeDB 2.19.0 版本开始,
mac
和linux
发行版均支持x86_64
/amd64
和>arm64
/aarch64
原生架构。这些版本比使用仿真在 Mac 上运行 x86_64 发行版更快。
现在安装非常简单,只需安装适用于您的本机操作系统+架构的 Java 运行时,然后通过 apt/brew 分发渠道或从 Github 发布页面为您的操作系统安装 TypeDB:https://github.com/vaticle/typedb/releases
As of the TypeDB 2.19.0 release, the
mac
andlinux
distributions support bothx86_64
/amd64
andarm64
/aarch64
architectures natively.These versions are faster than using emulation to run the x86_64 distributions on Macs in particular.
Installation is now as simple as installing a Java runtime that is applicable to your native OS+architecture, and then installing TypeDB for your OS via the apt/brew distribution channels or from the Github releases page: https://github.com/vaticle/typedb/releases