如何在 64 位机器上运行为 32 位制作的 API? [英] How to run an API made for 32-bit on a 64-bit machine?

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

问题描述

我正在编写一个 Java 应用程序,它必须通过 USB 电缆与 XBee 无线电进行通信.为此,我使用了 xbee-java API(http://code.google.com/p/xbee-api/)

I'm writing a java application which has to communicate with has to communicate with an XBee radio over a usb-cable.To do this , I use the xbee-java API (http://code.google.com/p/xbee-api/)

在我的旧 32 位机器上一切正常.但是当我将项目导入到 64 位机器时,它立即抛出一个异常,内容为:无法在 AMD 64 位平台上加载 IA 32 位 .dll".我不知道如何解决这个问题.

On my old 32-bit machine it all worked fine . But when I imported the project to a 64-bit machine , it throws immediately an exception which says :" Can't load IA 32-bit .dll on a AMD 64-bit platform" . I don't have any idea how I can solve this problem .

错误代码:

    java.lang.UnsatisfiedLinkError: C:UsersTomDocumentsXbeeJava
xtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RXTXCommDriver
Closing connection with local XBee
Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError: C:UsersTomDocumentsXbeeJava
xtxSerial.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
    at com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:71)
    at com.rapplogic.xbee.RxTxSerialComm.openSerialPort(RxTxSerialComm.java:61)
    at com.rapplogic.xbee.api.XBee.open(XBee.java:140)
    at me.server.HardwareCommunications.SensorListener.run(SensorListener.java:47)
    at java.lang.Thread.run(Unknown Source)

谢谢,汤姆

推荐答案

无法将 32 位 DLL 加载到 64 位进程中.

It is not possible to load a 32-bit DLL into a 64-bit process.

根据描述,您运行的 JVM 是 64 位,但 DLL rxtxSerial.dll 是 32 位.要解决,要么:

Based on the description, the JVM you are running is 64-bit but the DLL rxtxSerial.dll is 32-bit. To resolve, either:

  • 获取 64 位 rxtxSerial.dll,或
  • 安装并使用带有当前 rxtxSerial.dll
  • 的 32 位 JVM
  • Obtain 64-bit rxtxSerial.dll, or
  • Install and use 32-bit JVM with the current rxtxSerial.dll

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

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