简体   繁体   English

Java本机库体系结构取决于JVM还是OS?

[英]Java native library architecture depend on JVM or OS?

I want to load native library to Java program, which is fine but I don't know which architecture should I load. 我想将本机库加载到Java程序中,这很好,但是我不知道应该加载哪种体系结构。 If I'm running on x64 and I have a x64 JVM I will load 64 bit library but If I will run on x86 JVM on x64 what I should load ? 如果我在x64上运行,并且具有x64 JVM,则将加载64位库,但是如果我将在x64上的x86 JVM上运行,则应加载什么? It should be based on OS or JVM ? 它应该基于OS还是JVM?

Thank you 谢谢

The "bitness" of the native library must be the same as that of the JVM. 本机库的“位”必须与JVM的“位”相同。

If you are using a 32-bit JVM, you need a 32-bit native library (no matter if the OS is 32-bit or 64-bit). 如果使用的是32位JVM,则需要32位本机库(无论操作系统是32位还是64位)。

If you are using a 64-bit JVM, you need a 64-bit native library. 如果使用的是64位JVM,则需要一个64位本机库。

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

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