java - 在 64 位机器上运行 32 位 dll [英] Running 32-bit dll on 64-bit machine in java

查看:107
本文介绍了java - 在 64 位机器上运行 32 位 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 3rd-party dll 用于我用 java 编写的程序.不幸的是,它只支持 32 位.当我尝试在 64 位 VM 中加载 dll 时,出现以下错误:

I am attempting to use a 3rd-party dll for a program I am writing in java. Unfortunately, it only has 32-bit support. When I attempt to load the dll in a 64-bit VM, I get the following error:

Can't load IA 32-bit .dll on a AMD 64-bit platform

我曾尝试在 32 位 VM 中运行,该 VM 可在 Eclipse 中运行,但是当我导出项目时,出现相同的错误.请帮忙!

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

真诚的,本

推荐答案

不能在 64 位 Hotspot JVM 中使用 32 位 DLL.它不会工作.而且我不知道还有其他任何支持 32 位 DLL 的 64 位 JVM.

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.

确实,正如 Peter Lawrey 指出的那样,这不仅仅是 JVM 的限制.没有主流操作系统允许以 64 位模式运行的应用程序加载和使用 32 位库.

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.

您的选择是:

  • 切换到 32 位 JVM.(您可以在 64 位操作系统上运行 32 位 JVM ...)
  • 将 DLL 移植到 64 位.
  • 切换到纯 Java 或具有 64 位 DLL 的替代库.
  • 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.

我曾尝试在 32 位 VM 中运行,该 VM 可在 Eclipse 中运行,但是当我导出项目时,出现相同的错误.

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

这只能意味着您正在运行 32 位 JVM 以在 Eclipse 内运行应用程序,以及运行 64 位 JVM 以在 Eclipse 外部运行应用程序.(问题在于您如何运行应用程序,而不是您如何导出它...)

That can only mean that you are running a 32-bit JVM to run the application within 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 ...)

这篇关于java - 在 64 位机器上运行 32 位 dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆