I'm developing an application that makes use of libjahspotify. The program is running on my desktop (Windows 7), when attempting to run it on my laptop (Windows 8.1) or on my other Intel NUC (Windows 7) I am getting the below error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\temp\jahspotify.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at jahspotify.JahSpotifyNativeLoader.<init>(JahSpotifyNativeLoader.java:90)
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:408)
at java.lang.Class.newInstance(Class.java:438)
at jahspotify.impl.JahSpotifyImpl.<clinit>(JahSpotifyImpl.java:730)
at jahspotify.services.JahSpotifyService.initialize(JahSpotifyService.java:56)
at jahspotify.services.JahSpotifyService.getInstance(JahSpotifyService.java:26)
at jahspotify.services.JahSpotifyService.initialize(JahSpotifyService.java:39)
at net.functionseven.divicantus.spotify.Spotify.init(Spotify.java:29)
at net.functionseven.divicantus.Divicantus.main(Divicantus.java:20)
The native-jar in libjahspotify is supposed to load the dlls automatically, but does not. At this point it seems that jahspotify.dll is not loading. If I manually copy jahspotify.dll to the folder the native-jar will delete it, as its supposed to.
I've recompiled libjahspotify several times and checked it multiple times that both java and the dlls are x86. I've also attempted to load it manually with System.load(), I get a similar error like below.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: C:\temp\jahspotify.dll
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at net.functionseven.divicantus.Divicantus.main(Divicantus.java:24)
I'm at a loss to what is happening.
Most likely cause is that second system is missing some dlls that jahspotify.dll requires. You can check which dlls are required with Dependency Walker (http://www.dependencywalker.com/) and try manually putting these alongside jahspotify.dll. Commonly missing DLLs are from c++ redistributable packages and such.
Related
Hey I am making a game in java using slick and run into all these errors. It works on my friend's computer but not on mine. I've tried on both mac and pc.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at Game.start(Game.java:37)
at Main.main(Main.java:5)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
What does above exception mean??
I do have it in my class path.
The error message explains it all, you dont have a LWJGL on your classpath. You need to install it so as to get it working on your system.
Also you need to point the jvm to the location where the native files are located using a command line parameter -Djava.library.path="path/to/natives". JarSplice is an alternative to this
You may check this for details
The lwgjl native library cannot be found and loaded. Set the path to the folder where lwjgl.dll (if on Windows, on Mac probably liblwjgl.so) is located, with -D, for instance
java -Djava.library.path=C:\Java\ljwgl\libs com.mypackage.MyProgram
The library files must have a permission to be executed. Some computers may be configured to suppress any execution from USB stick so check.
If still does not work, try to call System.load(String fullFilePath) from your code, pointing to the location where the file clearly exists. If this works at the end, you can use this function to load library without name alterations and path assumptions. If does not, it may be wrong achitecture (64 vs 32 bit, permission problems (not executable) or the library file is just broken.
I am trying to run a Swing Client using Dynamic Code Evolution VM in IntelliJ using DCEVM integration plugin.When I start the app it crashes with following exception
Exception in thread "main" java.lang.UnsatisfiedLinkError: no freetype in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:59)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32)
And
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1012)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1624)
at javax.swing.plaf.synth.SynthGraphicsUtils.getPreferredSize(SynthGraphicsUtils.java:283)
at javax.swing.plaf.synth.SynthGraphicsUtils.getMinimumSize(SynthGraphicsUtils.java:195)
at javax.swing.plaf.synth.SynthButtonUI.getMinimumSize(SynthButtonUI.java:461)
I verified that SunFontManager is exist in rt.jar. Any idea?
DCEVM does not ship with fonts. So, when the JVM tries to load up the fonts, it doesn't find any and crashes. Fortunately, the fix is very easy. Simply copy the fonts from another JDK/JRE. You will find them at /jre/lib/fonts. Copy the entire directory to /lib.
I have a java project with processing elements that compiles and runs fine inside of Eclipse, but I need to export it to an executable. When I do this via Eclipse's export wizard, it produces a jar, but that jar produces runtime errors when it's double clicked or called from the command line. First it was giving me this:
C:\Users\Rachel\School\MQP>java -jar Simworm14.jar
Catched MalformedURLException: Could not open InputStream for URL 'rsrc:gluegen-
rt-natives-windows-amd64.jar', while addNativeJarLibsImpl(classFromJavaJar class
com.jogamp.common.os.Platform, classJarURI jar:rsrc:gluegen-rt.jar!/com/jogamp/
common/os/Platform.class, nativeJarBaseName gluegen-rt-natives-windows-amd64.jar
): [ rsrc:gluegen-rt.jar -> rsrc: ] + gluegen-rt-natives-windows-amd64.jar -> sl
im: jar:rsrc:gluegen-rt-natives-windows-amd64.jar!/
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: Can't loa
d library: C:\Users\Rachel\School\MQP\gluegen-rt.dll
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1706)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoad
erBase.java:551)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.ja
va:64)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL
ibLoaderBase.java:96)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.j
ava:414)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrar
y(DynamicLibraryBundle.java:388)
at com.jogamp.common.os.Platform$1.run(Platform.java:203)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:173)
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:62
44)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:16
25)
at processing.core.PApplet.run(PApplet.java:2177)
at java.lang.Thread.run(Thread.java:662)
So I tried pasting gluegen-rt.dll into the given directory, and then it gave me this error instead:
C:\Users\Rachel\School\MQP>java -jar Simworm14.jar
Catched MalformedURLException: Could not open InputStream for URL 'rsrc:gluegen-
rt-natives-windows-amd64.jar', while addNativeJarLibsImpl(classFromJavaJar class
com.jogamp.common.os.Platform, classJarURI jar:rsrc:gluegen-rt.jar!/com/jogamp/
common/os/Platform.class, nativeJarBaseName gluegen-rt-natives-windows-amd64.jar
): [ rsrc:gluegen-rt.jar -> rsrc: ] + gluegen-rt-natives-windows-amd64.jar -> sl
im: jar:rsrc:gluegen-rt-natives-windows-amd64.jar!/
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: C:\Users\
Rachel\School\MQP\gluegen-rt.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoad
erBase.java:551)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.ja
va:64)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL
ibLoaderBase.java:96)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.j
ava:414)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrar
y(DynamicLibraryBundle.java:388)
at com.jogamp.common.os.Platform$1.run(Platform.java:203)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:173)
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:62
44)
at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:16
25)
at processing.core.PApplet.run(PApplet.java:2177)
at java.lang.Thread.run(Thread.java:662)
After some googling, it appears this dependency issue might be a bug with jogl: https://java.net/jira/browse/JOGL-346 but I find it hard to believe that nobody has been able to export any processing applications from Eclipse. There's got to be a way, hasn't there?
Any suggestions?
Processing requires native libraries, which it doesn't look like you're including. You need to at least put the JOGL jar for the system you're on, but that won't help you deploy to other systems.
Shameless self-promotion: I wrote a tool that helps you create self-extracting runnable jar files that handle Processing's native libraries automatically so it works on every system: http://StaticVoidGames.com/SvgExe/
I set up a JRI project for NetBeans 7.4 using 32-bit R 3.0.2 and Java jdk1.7.0_45, on Windows 7, using the steps outlined here.
When I called
Rengine.versionCheck()
I got the following
Cannot find JRI native library!
Please make sure that the JRI native library is in a directory listed in java.library.path.
java.lang.UnsatisfiedLinkError: C:\Program Files\R\R-3.0.2\library\rJava\jri\jri.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19)
at rjava.RJava.main(RJava.java:40)
Java Result: 1
Following the suggestions here, I copied all of the dlls from
C:\Program Files\R\R-3.0.2\bin\i386
to the directory containing java.exe. I also right-cliked on the project and selected
Properties:Run:VM Options
and added
-Djava.library.path="C:\Program Files\R\R-3.0.2\library\rJava\jri;C:\Program Files\R\R-3.0.2\library\rJava\jri\i386"
The problem persisted. I tried prepending the following to my code.
System.loadLibrary("jri");
This resulted in
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\R\R-3.0.2\library\rJava\jri\jri.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at rjava.RJava.main(RJava.java:39)
Java Result: 1
I have done everything suggested here but the problem persists.
I had to restart NetBeans. That fixed the problems.
In fact, I found this part unnecessary.
Properties:Run:VM Options
-Djava.library.path="C:\Program Files\R\R-3.0.2\library\rJava\jri;C:\Program Files\R\R-3.0.2\library\rJava\jri\i386"
I'm trying to call JDIC from my application, but I can't get it to run. What files do I need and where? From what I've been able to gather from their site, I basically need to put jdic.jar in classpath... however there is also a lib folder with jdic.jar with a bit different size, and jdic_native_applet.jar, jdic_stub_unix.jar, jdic_stub_windows.jar and several folders with what I gather are platform specific files.
I get this exception when instantiating AssociationService:
java.lang.ClassNotFoundException: org.jdesktop.jdic.filetypes.internal.AppAssociationReaderFactory_windows
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.jdesktop.jdic.filetypes.AssociationService.<init>(Unknown Source)
at QuickTest.main(QuickTest.java:101)
I've tried last "official" release and last alpha release. I'm running Java 6 and Win7 64bit. Does JDIC even work under Win7 (or 64bit, although I use 32bit Java)? I see no release after 2006, and no activity in the project after about 2008... while Win7 came in 2009.
I know that parts of JDIC, like Desktop, were included in Java 6, however that doesn't seem to be the case with file associations.
And if it doesn't, are there any (hopefully cross-platform) alternatives for managing file associations? There are some things for Windows only that I tried, but that requires running native commands with administrator privileges which I don't know how to pull, apart from asking user to run my app as administrator and then use Runtime.exec()...
If there are no alternatives to JDIC, I'm interested if anyone has managed to handle file associations well with cross-platform installers?
UPDATE: OK, figured part of it... everything from windows folder needs to be in root folder. However now I get this exception which brings me back to my original question:
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Sources\TheWorkspace\Test\jdic.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at org.jdesktop.jdic.init.JdicManager$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.jdesktop.jdic.init.JdicManager.loadLibrary(Unknown Source)
at org.jdesktop.jdic.filetypes.internal.WinRegistryWrapper.<clinit>(WinRegistryWrapper.java:36)
at org.jdesktop.jdic.filetypes.internal.WinRegistryUtil.isSubKeyExist(WinRegistryUtil.java:192)
at org.jdesktop.jdic.filetypes.internal.WinRegistryUtil.isFileExtExist(WinRegistryUtil.java:910)
at org.jdesktop.jdic.filetypes.internal.WinRegistryUtil.isFileExtExist(WinRegistryUtil.java:939)
at org.jdesktop.jdic.filetypes.internal.WinAppAssociationReader.isFileExtExist(WinAppAssociationReader.java:163)
at org.jdesktop.jdic.filetypes.AssociationService.getFileExtensionAssociation(Unknown Source)
at QuickTest.main(QuickTest.java:103)
Can you recheck the java you are using to run this? The error typically occurs when trying to load a 32-bit dll from a 64-bit java. jdic does work for us on 64-bit Windows 7 with 32-bit java.