简体   繁体   English

Java 7将在Mac上以32位运行

[英]Java 7 to be run in 32 bit on mac

I am building a desktop Java application. 我正在构建一个桌面Java应用程序。 It uses a third party framework for some low level work (it is in C and I have used JNA). 它使用第三方框架进行一些底层工作(在C语言中,我使用过JNA)。

On my Windows Machine, when I do Native.loadLibrary("EDSDK.dll", EdSdkLibrary.class, options); 在Windows计算机上,当我执行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); 在Mac上,当我尝试执行Native.loadLibrary("EDSDK.framework", EdSdkLibrary.class, options); it threw UnsatisfiedLinkError saying: mach-o, but wrong architecture 它抛出了UnsatisfiedLinkError说: mach-o, but wrong architecture

My java 7 version is 64 bit and the framework is 32 bit based. 我的Java 7版本是64位,框架是基于32位的。 On a different mac containing Java6, when I ran Java in 32 bit mode, the application works well. 在包含Java6的另一台Mac上,当我以32位模式运行Java时,该应用程序运行良好。 This confirms the exception thrown was because of 32 bit incompatibility and I need to use 32 bit only(which is obvious). 这确认抛出异常是由于32位不兼容,我只需要使用32位(这很明显)。

This is the irritating part- In Java 7, -d32 option doesn't work and Oracle no longer gives Java 7 in 32 bit. 这是令人烦恼的部分-在Java 7中, -d32选项不起作用,Oracle不再提供32位Java 7。 How do I run my Java 7 in 32 bit so that I can use the third party framework? 如何以32位运行Java 7,以便可以使用第三方框架? Open JDK? 打开JDK? Or use Java 6 and use it in 32 bit mode. 或者使用Java 6并以32位模式使用它。 But Oracle no longer provides Java 6 for Mac. 但是Oracle不再为Mac提供Java 6。

Any other alternative?? 还有其他选择吗?

You can download the Apple Java 6 JDK , which does include a 32 bit JVM. 您可以下载确实包含32位JVM的Apple Java 6 JDK 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 6的未来安全更新方式是否很多,因此最好掌握本机框架的64位版本并将其与Oracle Java 7结合使用。

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

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