Running 32-bit dll on 64-bit machine in java

十年热恋 提交于 2019-12-05 08:01:30

You cannot use a 32-bit DLL in a 64-bit Hotspot JVM. It won't work. And I don't know of any other 64-bit JVM that supports 32-bit DLLs.

Indeed, as Peter Lawrey points out, this is not just a JVM limitation. No mainstream operating system allows an application running in 64-bit mode to load and use a 32-bit library.

Your choices are:

  • Switch to a 32-bit JVM. (You can run a 32bit JVM on a 64-bit OS ...)
  • Port the DLL to 64-bit.
  • Switch to an alternative library that is pure Java, or has a 64-bit DLL.

I have tried running in a 32-bit VM, which works in eclipse, but when I export the project, I get the same error.

That can only mean that you are running a 32-bit JVM to run Eclipse, and a 64-bit JVM to run the application outside of Eclipse. (The issue is how you run the application, not how you export it ...)

The only way to use a 32-bit shared library from a 64-bit JVM is to run an additional 32-bit JVM and access it via RMI, JMS or some form of messaging.

Its an intrinsic limitation of 64-bit programs (not just Java) that it cannot exchange pointers with a 32-bit library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!