简体   繁体   English

使用JNI时与64位和32位混淆

[英]Confused with 64bit and 32 bit when using JNI

I have a Java project running under windows. 我有一个在Windows下运行的Java项目。 It uses several native functions from a .DLL file via JNI. 它通过JNI使用.DLL文件中的多个本机函数。 Everything works well under 32bit windows. 在32位Windows下,一切正常。

In order to support 64bit windows, I need to deal with the following questions first: 为了支持64位Windows,我需要首先处理以下问题:

  1. Can I load a 32bit DLL under 32bit VM in 64bit windows? 我可以在64位Windows中的32位VM下加载32位DLL吗?
  2. Can I load a 32bit DLL under 64bit VM in 64bit windows? 我可以在64位Windows中的64位VM下加载32位DLL吗?
  3. Can I load a 64bit DLL under 32bit VM in 64bit windows? 我可以在64位Windows中的32位VM下加载64位DLL吗?
  4. How can I know which DLL file to load? 我怎么知道要加载哪个DLL文件?

Thank you very much! 非常感谢你!

A 64-bit OS can run a 32-bit or 64-bit application. 64位操作系统可以运行32位或64位应用程序。

A 32-bit application can only load 32-bit DLL or shared libraries. 32位应用程序只能加载32位DLL或共享库。

A 64-bit application can only load 64-bit DLL or shared libraries. 64位应用程序只能加载64位DLL或共享库。

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

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