java.lang.UnsatisfiedLinkError,mach-o 但 Mac10.6.2 上的架构错误

发布于 2024-08-22 02:40:10 字数 564 浏览 3 评论 0原文

我试图在本地计算机上运行一个项目。

我尝试加载这个 jnilib 文件,该文件是我在 Mac 10.6.2 上从该项目的运行实例获得的,

System.load(lib.getAbsolutePath());

然后抛出此异常:

java.lang.UnsatisfiedLinkError, mach-o but wrong architecture

我已使用文件命令检查 jnilib:

libScreenMatchProxy.jnilib: Mach-O dynamically linked shared library i386

我猜这是因为 jnilib 文件已编译32位,但Mac10.6附带的Java是64位。所以我先进入Java首选项并将Java设置为使用32位。但这没有用。

如上所述,这个 jnilib 文件是从我的 Mac 上正在运行的项目实例复制的,因此它应该可以工作。我不明白为什么它可以在已安装的应用程序中工作,但不能在我的 Eclipse 中工作。

I was trying to run a project in my local machine.

I tried to load this jnilib file which I got from a running instance of this project on my Mac 10.6.2,

System.load(lib.getAbsolutePath());

then I got this exception thrown:

java.lang.UnsatisfiedLinkError, mach-o but wrong architecture

I have check the jnilib with file command:

libScreenMatchProxy.jnilib: Mach-O dynamically linked shared library i386

I guess this is because the jnilib file is compiled in 32bit but the Java comes with Mac10.6 is 64bit. So I go to Java Preference and set Java to use 32bit first. But it didn't work.

As mentioned above, this jnilib file is copied from a running instance of the project on my Mac, so it should work. I don't understand why it working in the installed application but not in my Eclipse.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

黎歌 2024-08-29 02:40:10

将“-d32”添加到运行配置中的 VM 参数将强制 Eclipse 以 32 位模式调用 Java。这将解决这个问题。

Adding "-d32" to the VM argument from Run Configuration will force Eclipse to call Java in 32bit mode. That will solve this problem.

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