• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Load DLL but getting Can't load AMD 64-bit .dll on a IA 32-bit platform

 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any information on this would be great,

I am loading a Windows DLL using Java but getting the following stack trace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Files\name.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at Test.main(Test.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Any ideas as to how to fix this or is this dependent on the JDK used?

Thanks in Advance,

Niall
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message suggest to me you're trying to load a 64-bit DLL on a 32-bit platform.
 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aye, i think so as well,

but is a Java JVM issue or a hardware issue?

Is there a way around this?

Thanks
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a hardware issue. 64-bit DLLs don't work on 32-bit machines.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:It's a hardware issue. 64-bit DLLs don't work on 32-bit machines.

Or more specifically, they don't work on 32-bit Windows (even on 64-bit machines).
 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, Thanks for the info,

So there is no way around this, except for either:
* getting the 32-bit Windows version of the DLL
* getting a 64-Windows OS installed on the computer
?

Cheers
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's it. Just for your information, even on 32-bit Windows it is possible to run a virtualization software (eg. a VMWare, though a non-commercial alternatives surely exist) and install a 64-bit OS into that. You might only need to set up the BIOS to support 64 bit OS (I faintly remember I had to do so). This option can come in handy and might not be that obvious.

Plus, one more thing! You also need to run 64-bit JRE to use a 64-bit DLL. It is possible to run a 32-bit JRE on 64 bit system, in which case you also cannot link to a 64-bit DLL,
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15219
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no way around this; you must either get a 32-bit version of the DLL, or run your program on a computer with 64-bit Windows (and 64-bit Java) installed.
 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool,

Thanks for all the info,

Cheers
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:It's a hardware issue. 64-bit DLLs don't work on 32-bit machines.

It's actually a software issue. It's the OS and calling application (in this case the JVM) that determine whether or not 64-bit DLLs can be used. You can take a 64-bit machine, with a 64-bit Windows, and a 32-bit JVM, and the 64-bit DLL still can't be used.
Of course you need a 64-bit Windows (or other OS) to run a 64-bit JVM, and you need a 64-bit machine to run a 64-bit OS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic