Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run an API made for 32-bit on a 64-bit machine?

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/)

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 .

the error code :

    java.lang.UnsatisfiedLinkError: C:\Users\Tom\Documents\XbeeJava\rxtxSerial.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:\Users\Tom\Documents\XbeeJava\rxtxSerial.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)

Thanks , Tom

like image 969
tb96 Avatar asked Feb 21 '12 14:02

tb96


People also ask

Is there a way to run 32-bit programs on 64-bit?

WOW64 is the x86 emulator that allows 32-bit Windows-based applications to run seamlessly on 64-bit Windows. This allows for 32-bit (x86) Windows applications to run seamlessly in 64-bit (x64) Windows, as well as for 32-bit (x86) and 32-bit (ARM) Windows applications to run seamlessly in 64-bit (ARM64) Windows.

Is Win32 a 64-bit?

(2) Win32 is the programming interface (API) for 32-bit and 64-bit Windows operating systems. Starting with Windows 95, developers write applications that call the routines in the Win32 API.


2 Answers

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

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

  • Obtain 64-bit rxtxSerial.dll, or
  • Install and use 32-bit JVM with the current rxtxSerial.dll
like image 147
hmjd Avatar answered Oct 02 '22 04:10

hmjd


A 64-bit executable (and process) (your Java VM) can only use 64 bit DLLs.

But you could download, install and run a 32-bit version of Java. Unless you also need to access 64 bit DLLs or need more than 2 to 3 GB of memory, the 32 bit Java VM will run fine on a 64 bit machine.

like image 26
Codo Avatar answered Oct 02 '22 06:10

Codo