Java 7将在Mac上以32位运行 [英] Java 7 to be run in 32 bit on mac

查看:120
本文介绍了Java 7将在Mac上以32位运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个桌面Java应用程序。它使用第三方框架进行一些底层工作(在C语言中,我使用过JNA)。

I am building a desktop Java application. It uses a third party framework for some low level work (it is in C and I have used JNA).

在Windows计算机上,当我执行 Native.loadLibrary( EDSDK.dll,EdSdkLibrary.class,options); 效果很好。在Mac上,当我尝试执行 Native.loadLibrary( EDSDK.framework,EdSdkLibrary.class,options); 时,它抛出了 UnsatisfiedLinkError 说: mach-o,但是体系结构错误

On my Windows Machine, when I do Native.loadLibrary("EDSDK.dll", EdSdkLibrary.class, options); it works perfectly well. On Mac when I try to do Native.loadLibrary("EDSDK.framework", EdSdkLibrary.class, options); it threw UnsatisfiedLinkError saying: mach-o, but wrong architecture

我的Java 7版本是64位并且框架基于32位。在包含Java6的另一台Mac上,当我以32位模式运行Java时,该应用程序运行良好。
这确认抛出异常是因为32位不兼容,我只需要使用32位(这很明显)。

My java 7 version is 64 bit and the framework is 32 bit based. On a different mac containing Java6, when I ran Java in 32 bit mode, the application works well. This confirms the exception thrown was because of 32 bit incompatibility and I need to use 32 bit only(which is obvious).

这是令人不快的部分-在Java 7中, -d32 选项不起作用,Oracle不再提供Java 7 in 32位。如何以32位运行Java 7,以便可以使用第三方框架?打开JDK?或者使用Java 6并以32位模式使用它。但是Oracle不再为Mac提供Java 6。

This is the irritating part- In Java 7, -d32 option doesn't work and Oracle no longer gives Java 7 in 32 bit. How do I run my Java 7 in 32 bit so that I can use the third party framework? Open JDK? Or use Java 6 and use it in 32 bit mode. But Oracle no longer provides Java 6 for Mac.

还有其他选择吗?

推荐答案

您可以下载 Apple Java 6 JDK ,其中确实包含32位JVM 。但是我怀疑Java 6的未来安全更新方式是否很多,因此最好掌握本机框架的64位版本并将其与Oracle Java 7结合使用。

You can download the Apple Java 6 JDK, which does include a 32 bit JVM. But I doubt there will be much in the way of future security updates for Java 6, so you would be better off getting hold of a 64 bit version of the native framework and using that with Oracle Java 7.

这篇关于Java 7将在Mac上以32位运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆