Can't load IA 32-bit .dll on a AMD 64-bit (rxtx)

2.9k views Asked by At

I would like to use rxtx library to connect to a serial port. I've already tested a program that identifies available ports and communicate.However, when I export it as a runnable jar file.

I execute it with below command.

java -jar prog.jar

It shows this error and fails (Can't load IA 32-bit .dll on a AMD 64-bit )

What can be wrong ?

2

There are 2 answers

10
kaza On

This provides some details on how to get jvm args used by eclipse...

How can I specify the default JVM arguments for programs I run from eclipse?

In essence check Project Properties -> Run Configurations -> Arguments Tab ->JVM Args (second box below Program Arguments) enter image description here You should copy those arguments and use them in your java <jvmArgs> -jar prog.jar

Check JRE as per below you should use the java from this bin

https://stackoverflow.com/a/4440223/6935152 Project->Properties and choose Java Build Pathand choose the Libraries tab. Find the JRE System Library 

0
Davut Gürbüz On

Right answer is %99.9 percent you have 64 bit JRE but running with 32bit rxtx. Just install x86 runtime if possible. Problem will be solved.

Aslo consider putting rxtxSerial.dll into syswow64 folder not system32. Normally no need if they're in your classpath working directory.

"The “WOW64” part of the name here refers to Microsoft’s “Windows 32-bit on Windows 64-bit” software, which is a part of the operating system. This allows Windows to run 32-bit programs on a 64-bit version of Windows. WoW64 redirects file access to ensure programs will work properly."

https://www.howtogeek.com/326509/whats-the-difference-between-the-system32-and-syswow64-folders-in-windows/

You can also consider following these steps. http://rxtx.qbang.org/wiki/index.php/Installation_for_Windows