I've recently installed ImageMagick 6.3.9 and JMagick 6.3.9. from here via ImageMagick-6.3.9-0-Q8-windows-dll.exe
and jmagick-win-6.3.9-Q8.zip
.
I added jmagick.jar
to my project's libraries in NetBeans, and set the classpath to include the folder where ImageMagick is installed (where I also put jmagick.dll
).
This is all I've done.
However, when I run my program (which only declares a MagickImage
and initializes it) I get this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\ImageMagick-6.3.9-Q8\jmagick.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1855)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at magick.MagickLoader.<clinit>(MagickLoader.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at magick.Magick.<clinit>(Magick.java:21)
at opengltutorials.Texture.<init>(Texture.java:36)
at opengltutorials.Mesh.initMaterials(Mesh.java:199)
at opengltutorials.Mesh.initFromScene(Mesh.java:148)
at opengltutorials.Mesh.loadMesh(Mesh.java:136)
at opengltutorials.Tutorial.init(Tutorial.java:79)
at opengltutorials.Tutorial.main(Tutorial.java:156)
Java Result: 1
Why is this happening, and how can I fix it?
I had the same problem, until I read this blog entry that said to restart the computer first. I did and stopped seeing the error.