Saturday, May 10, 2014

tibrvnative.dll : Can't load IA 32-bit .dll on a AMD 64-bit platform - Windows 8

Can't load IA 32-bit .dll on a AMD 64-bit platform is a generic error, which comes when a 64-bit process tries to load a 32-bit dll, but when it comes its not that easy to resolve. One of my reader was getting this error tibrvnative.dll : Can't load IA 32-bit .dll on a AMD 64-bit when he was trying to install Tibco Rendezvous 8.2 on his Windows 8 HP Laptop. He was working on Java application which was dependent upon Tibco Rendezvous for inter process communication. After installing Tibco on his machine he was having hard time to run his Java application, first he was getting errors like java.lang.UnsatisfiedLinkError: no tibrvnative in java.library.path and after resolving that he was getting a new error tibrvnative.dll: Can't find dependent libraries. After lot of research and trial and error, he found that the version he was trying e.g. Tibco Rendezvous 8.2 was not supported for Windows 8 operating system. That installer was working find on Windows 7 and XP but not working on Windows 8. At last, when he upgraded to latest Tibco Rendezvous version 8.4.1, which supposed to work on windows 8, he started getting a new error Can't load IA 32-bit .dll on a AMD 64-bit platform. Frustrated with all these errors, he was about to give up, when he emailed me. I suggested to try running his Java application, which was using Tibco Rendezvous, with 32-bit JVM rather than  64-bit JVM, which he was initially running because of 64-bit configuration of his notebook. I also suggested him to execute sample programs from Tibco installation, before running your Java application, it's not only quick but also isolate the issue. Thankfully running on 32-bit JVM did work for him, which motivates me to post the solution here.


Solution : Use 32-bit JDK for running Tibco or any other 32-bit dll

Can't load IA 32-bit .dll on a AMD 64-bit platform
As I said, it's a general problem, where 32-bit dll is used  by x64 based process e.g. JDK 1.7 x64 JVM, so It can come not only with Tibco Rendezvous but also with any other Java JNI application which is using  native library. Ideally you should get version which is compatible to your operating system, architecture and JVM e.g. dll which are compiled as 64-bit, but if that's not an option than loading those dll by a 32-bit process is the next best solution. Good thing about this whole issue is that you can run 32-bit JVM in 64-bit machine. You just need to download correct installer e.g. jdk-7u40-windows-i586 which is meant for x86 windows machine. If you are running your program in Eclipse, than you also need to first configure this JRE as preferred JRE among all installed JRE/JDK, and then let your project use this 32-bit JDK, instead of 64-bit one. On another note you should always use 64-bit version of any software if you are running on 64-bit architecture and 64-bit operating System like Windows 8. I am not sure, if he had downloaded the 32-bit version of Tibco Rendezvous instead of 64-bit version, because all this error says is that Tibco was compiled for 32-bit and Java was running on 64-bit machine. A more common problem occurs when you run daily use Java software like Eclipse IDE into 64-bit machine. You can run into issues like No Java virtual machine was found error, always prefer trio of 64-bit for Eclipse, Java and Windows 8 if you can. Same rule applies for any other native library or software.

That's all guys, In short, if you ever get error Can't load IA 32-bit .dll on a AMD 64-bit platform, use 32-bit JVM to run your native 32-bit dll. You may get this very same error in Windows 7 or Windows 8, which are two popular 64-bit operating system. Best is to get correct installer, but if it doesn't happen try this trick to solve  "Can't load IA 32-bit .dll on a AMD 64-bit platform error" in Java based application.

1 comment :

Anonymous said...

This problem is popular when you work on 64-bit JVM and try to use 32-bit libs.
I remember when I had this problem with LeJOS on some project.

To be honest its not a hard-to-solve problem but still, there are times when you are exhausted by the whole day, you add some 32-bit lib on your 64-bit JVM getting in effect "Can't load IA 32-bit .dll on a AMD 64-bit" and have no clue what the friendly-word.

Anyway nice art.
If you have time could you make one about why use 64-bit JVM on 64-bit machines, it would be great. But it would be a long one I guess.

Post a Comment