在 M1 MacBook 上运行 TypeDB 时出现 UnsatisfiedLinkError

发布于 2025-01-09 07:12:09 字数 552 浏览 1 评论 0原文

我尝试使用 ./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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

段念尘 2025-01-16 07:12:09

TypeDB v2.19 或更高版本

从 TypeDB 2.19.0 开始,TypeDB 支持本机 Mac 和 Linux arm 架构。只需安装本机 Java 运行时即可运行 TypeDB。

旧版本的 TypeDB

⚠️ 在 TypeDB 2.19.0 之前,没有适用于 aarch64 (ARM) 的发行版。自 2023 年 7 月 6 日起,最佳解决方案升级到 TypeDB 2.19.0 或更高版本。如果通过 Homebrew 执行此操作,请确保您使用的是 brew 的 ARM64 安装(即默认设置)。

如果运行的 JDK 目标为 aarch64 (ARM)(M1 Mac 使用的架构),则启动时会抛出 UnsatisfiedLinkError。 TypeDB

例如,要安装 Eclipse Temurin(基于 OpenJDK):

  1. 访问 https:// /adoptium.net/en-GB/temurin/releases/?version=11 浏览 Temurin 版本
  2. 通过操作选择 JDK 11.pkg 发行版系统 MacOS 和体系结构 x64
  3. 下载并安装下面列表中显示的 Java 二进制文件
  4. 通过运行 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

⚠️ Prior to TypeDB 2.19.0, there were no distributions available for aarch64 (ARM). As of Jul 6, 2023, the best solution is to upgrade to TypeDB 2.19.0 or above. If doing so through Homebrew, ensure you are using an ARM64 installation of brew (i.e. the default).

If the running JDK targets aarch64 (ARM), the architecture used by an M1 Mac, then an UnsatisfiedLinkError 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 targets x64 architecture is installed.

For example, to install Eclipse Temurin (based upon OpenJDK):

  1. Visit https://adoptium.net/en-GB/temurin/releases/?version=11 to browse Temurin releases
  2. Select the .pkg distribution of JDK 11 with operating system MacOS and architecture x64
  3. Download and install the Java binary displayed in the list below
  4. Verify that Java was installed correctly by running java --version; the output should match the downloaded JDK version

Please note that this method relies on MacOS's Rosetta translation, which will inflict a performance overhead.

哆兒滾 2025-01-16 07:12:09

我的电脑是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.

千秋岁 2025-01-16 07:12:09

从 TypeDB 2.19.0 版本开始,maclinux 发行版均支持 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 and linux distributions support both x86_64/amd64 and arm64/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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文