简体   繁体   English

在 M1 MacBook 上运行 TypeDB 时出现 UnsatisfiedLinkError

[英]UnsatisfiedLinkError when running TypeDB on an M1 MacBook

I tried running TypeDB on my M1 MacBook using ./typedb server , but it results in the following error:我尝试使用./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)

This error looks like it might occur when running a Java program with an incompatible JDK.此错误看起来可能是在使用不兼容的 JDK 运行 Java 程序时发生的。 What can I do to resolve it?我能做些什么来解决它?

If the running JDK targets aarch64 (ARM), the architecture used by an M1 Mac, then an UnsatisfiedLinkError is thrown at startup.如果正在运行的 JDK 以aarch64 (ARM) 为目标,即 M1 Mac 使用的体系结构,则会在启动时抛出UnsatisfiedLinkError There is no native ARM build of TypeDB yet, so in order for TypeDB to run correctly on an M1 MacBook you need to ensure that a JDK that targets x64 architecture is installed.目前还没有原生的 ARM 版本的 TypeDB,因此为了让 TypeDB 在 M1 MacBook 上正确运行,您需要确保安装了面向x64架构的 JDK。

For example, to install Eclipse Temurin (based upon OpenJDK):例如,要安装 Eclipse Temurin(基于 OpenJDK):

  1. Visit https://adoptium.net/en-GB/temurin/releases/?version=11 to browse Temurin releases访问https://adoptium.net/en-GB/temurin/releases/?version=11浏览 Temurin 版本
  2. Select the .pkg distribution of JDK 11 with operating system MacOS and architecture x64 Select JDK 11.pkg发行版,操作系统为MacOS ,架构为x64
  3. Download and install the Java binary displayed in the list below下载并安装下面列表中显示的 Java 二进制文件
  4. Verify that Java was installed correctly by running java --version ;通过运行java --version验证 Java 是否已正确安装; the output should match the downloaded JDK version output 应该与下载的 JDK 版本匹配

Please note that this method relies on MacOS's Rosetta translation , which will inflict a performance overhead on the application.请注意,此方法依赖于 MacOS 的Rosetta 翻译,这将对应用程序造成性能开销。

My computer is MacBookAir M1.我的电脑是 MacBookAir M1。 And I encountered this problem too.我也遇到了这个问题。

I tried Java 17 and Java 8, and both were filed.我试了Java 17和Java 8,都被归档了。 Finally, when I switch to Java 11, the error disappeared.最后,当我切换到 Java 11 时,错误消失了。 Hope this helps.希望这可以帮助。

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

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