java.lang.UnsatisfiedLinkError: Can't load AMD 64-bit .dll on a IA 32-bit platform
16,995
The Dll is compiled for 64 bit ( amd64 or x86_64 ) platform/cpu architecture while your windows OS/JVM/JRE installation is/are 32 bit.
Either get a 32 bit version of the dll or upgrade your working environment ( either OS or JVM/JRE installation
Author by
Computer Science
Updated on June 04, 2022Comments
-
Computer Science almost 2 years
Encountered this java.lang.UnsatisfiedLinkError: Can't load AMD 64-bit .dll on a IA 32-bit platform when trying to run java file in netbeans ide. Not sure where to begin for debugging and fixing code.
Source code follows:
package demojni; public class Main { static { System.load("C:\\Users\\Nicholas1\\Documents\\NetBeansProjects\\DemoJNI_Lib\\dist\\DemoJNI_Lib.dll"); // Load native library at runtime // hello.dll (Windows) or libhello.so (Unixes) } // Declare a native method sayHello() that receives nothing and returns void // Test Driver public static void main(String[] args) { new Main().sayHelloWorld(); // invoke the native method } private native void sayHelloWorld(); }
-
Computer Science about 7 yearsGreat, thank you for your timely response. My Os is Windows 8 64-bit, how do I check the version of JRE. Also the JRE is 32-bit then how to upgrade just the JRE to 64-bit?
-
Computer Science about 7 yearsI run the java -version with command prompt and it returned the version and not the xx-bit; java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode, sharing)
-
Sheinbergon about 7 years
-
Computer Science about 7 yearsGreat it return "32". Now what? Do I only upgrade the JRE on my machine, and if so how?
-
Sheinbergon about 7 yearsRemove the JRE installation and make sure you download the x64 version from here - oracle.com/technetwork/java/javase/downloads/…. Also please accept my answer once you're done :)
-
Computer Science about 7 yearsI went to oracle.com/technetwork/java/javase/downloads/… and download the "Windows x64" for "Java SE Runtime Environment 8u121". After the install was complete I ran the System.getProperty("sun.arch.data.model"); again in netbeans and it returned 32 again. I will accept your answer, but What can I do now?
-
Sheinbergon about 7 yearsMake sure your netbeans IDE is not using an internal JDK. What does it say under Tools -> Java Platforms ?
-
Computer Science about 7 yearsNetbeans Java Platform Manager says; "JDK 1.6 (default)" under J2SE. found at C:\Program Files\Java\jdk1.6.0. What does that mean?
-
Sheinbergon about 7 yearsJesus, that's old. Change it use the one you just installed ( should be Jdk1.8*) in ProgramFiles or ProgramFiles (x86)
-
Computer Science about 7 yearsYes, this is true. Netbeans will not allow me to remove jdk 1.6, I added the JDK 1.8 as a Platform, how do I change the default to JDK 1.8?
-
Sheinbergon about 7 yearsProject -> (Right-Click) Properties -> Build -> Compile -> Java Platform I'd strongly advise to reinstall Netbeans and upgrade to a newer version, as I'm assuming your netbeans is as old as your jdk1.6
-
Computer Science about 7 yearsWhat was that extention for, was it for default jdk? Also I'm upgrading my netbeans now.
-
Computer Science about 7 yearsDo you know why the "System.getProperty("sun.arch.data.model");" is returning 32bit even after the JRE update to 64bit?
-
Computer Science about 7 yearsDo you think the old JDK 1.6 is the issue? Do you think it could be incorrect environment variables?
-
Computer Science about 7 yearsFinished install of Netbeans 8.2, the JDK for Netbeans location is C:\Program Files\Java\jdk1.8.0_111. Does this look right?
-
Sheinbergon about 7 yearsYep, that seems about right. your programs probably still executed under the older 1.6 JDK, that's all.
-
Computer Science about 7 yearsDo you know why the "System.getProperty("sun.arch.data.model");" is returning 32bit even after the JRE update to 64bit? Do you think the old JDK 1.6 is the issue? Do you think it could be incorrect environment variables
-
Computer Science about 7 yearsFinally the "System.getProperty("sun.arch.data.model");" is returning 64bit, probably because of the JDK 1.6, How can I ensure the other programs run on the newer JDK 1.8? Wierdly enough now I cant access Project->Properties directly, I have to Project->(right click)->Set Configurations-> Customize. Could this be a bug in the new IDE? Also my java project compiling is running into a new runtime error, # A fatal error has been detected by the Java Runtime Environment: # EXCEPTION_ACCESS_VIOLATION
-
Sheinbergon about 7 yearsWhat's inside ``` C:\Users\Nicholas1\Documents\NetBeansProjects\DemoJNI\hs_err_pid34736.log ``` ?. Are you able to compile your app/code and run it separately ?
-
Computer Science about 7 yearsThread information, very similar to this link stackoverflow.com/questions/9986227/…. Some said its a JRE bug. And when I changed my Netbeans-6.9.2 IDE default JDK to JDK 1.7 I didnt get the same runtime project error. but when I changed the Netbeans-6.9.2 IDE default JDK to JDK jdk1.8.0_111 Netbeans crashes on restart. I used this link to change default JDK for Netbeans: stackoverflow.com/questions/2809366/…
-
Computer Science about 7 yearsHere is the link to my error: stackoverflow.com/questions/43313847/… Right now I am able to compile and run clean/builds of my project but getting a successful run is not happening. Also my other java projects work fine.