user3365687
user3365687

Reputation: 91

Confused with 64bit and 32 bit when using JNI

I have a Java project running under windows. It uses several native functions from a .DLL file via JNI. Everything works well under 32bit windows.

In order to support 64bit windows, I need to deal with the following questions first:

  1. Can I load a 32bit DLL under 32bit VM in 64bit windows?
  2. Can I load a 32bit DLL under 64bit VM in 64bit windows?
  3. Can I load a 64bit DLL under 32bit VM in 64bit windows?
  4. How can I know which DLL file to load?

Thank you very much!

Upvotes: 0

Views: 966

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533432

A 64-bit OS can run a 32-bit or 64-bit application.

A 32-bit application can only load 32-bit DLL or shared libraries.

A 64-bit application can only load 64-bit DLL or shared libraries.

Upvotes: 1

Related Questions