0

I am using a library that requires that I load load dynamic linking libraries. My source code that uses these libraries is identical, the only difference is the operating system that I am using and which version of the library (Windows-64 version or Linux-64 version) that I am using. The library I am using provides 1 set for Windows ".dll" files and 1 set for Linux ".so" files, each in its own folder. To load the Linux ".so" libraries, I do

"-Djava.library.path=/home/johnmichaelreed/Desktop/Dropbox/Moved_Netbeans_Projects/Crazy_Client/Libjitsi_linux_64/lib/native/linux-64"

in the VM options and everything works.

Then, when I copy and paste the directory where the Windows ".dll" native libraries are into the VM options, I get rid of the Linux libraries path and insert:

 -Djava.library.path=C:\Users\JohnReedLOL\Desktop\Dropbox\Moved_Netbeans_Projects\Crazy_Client\Libjitsi_windows_64\lib\windows_native\windows-64

I then change the library JAR files to the ones that came with the Windows version of the Library and I run the program and I get this error:

SEVERE: Failed to register custom Renderer org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRenderer with JMF.
java.lang.UnsatisfiedLinkError: C:\Users\JohnReedLOL\Desktop\Crazy_Client\Libjitsi_windows_64\lib\windows_native\windows-64\jnawtrenderer.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:1119)
    at org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRenderer.<clinit>(JAWTRenderer.java:90)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:260)
    at org.jitsi.impl.neomedia.device.DeviceConfiguration.registerCustomRenderers(DeviceConfiguration.java:1034)
    at org.jitsi.impl.neomedia.device.DeviceConfiguration.<init>(DeviceConfiguration.java:355)
    at org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:150)
    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 org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:142)
    at org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
    at org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
    at outermost_crazy.Libjitsi_Main.<init>(Libjitsi_Main.java:124)
    at outermost_crazy.Libjitsi_Main.main(Libjitsi_Main.java:827)

The weird thing is I am 100% sure that the native library path is the right place because when I print it using System.getProperty("java.library.path"), I get the folder:

C:\Users\JohnReedLOL\Desktop\Dropbox\Moved_Netbeans_Projects\Crazy_Client\Libjitsi_windows_64\lib\windows_native\windows-64

^ This folder definitely has all 12 .dll files ^. The library JAR files that I am using are the ones the ones that came with these 12 ".dll" files, not the ones that came with the Linux ".so" files, so I am pretty sure that I am using the right JAR files. Why this is error only happening on Windows with the .dll files, but not on Linux with the .so files?

Dependency Walker opening of jnawtrenderer.dll: Dependency Walker Screenshot

  • 1
    Do both the DLL and your JVM have the same "bitness" (32 bit jvm + 32 bit DLL or 64 bit jvm + 64 bit DLL)? Mixing 32 and 64 bit doesn't work on winddows. – Axel May 27 '15 at 13:45
  • Maybe some transitive dependency issue? See e.g. http://stackoverflow.com/a/10549555/1015327. - Can you test loading the .dll outside of a JVM? – JimmyB May 27 '15 at 14:08
  • @Axel - The native libraries are in folders "windows-64" and "linux-64". Printing out the system property "sun.arch.data.model", I get "64" (bit) for Linux and "64" (bit) for windows. –  May 27 '15 at 14:31
  • @HannoBinder - I downloaded Dependency Walker and opened the jnawtrenderer.dll file in question. Don't know how to use this tool yet, but working on it. –  May 27 '15 at 14:55
  • 1
    Looks like `JAWT.DLL` may not be present at the right location, e.g. in the `PATH`. – JimmyB May 27 '15 at 15:37
  • I tried changing my Eclipse run configuration path by appending ";${env_var:PATH}" to it, which increased the number of folders in the native path. Now, when I print the value of Java environmental property 'System.getProperty("java.library.path")', I get: C:\Users\JohnReedLOL\Desktop\Eclipse_IDE\Eclipse_Workspace\Crazy_Client\New_Libjitsi_Windows_64\lib\native\windows-64;C:/Program Files/Java/jdk1.8.0_31/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_31/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_31/bin/../jre/lib/amd64; ... –  May 28 '15 at 19:24
  • But even though the "jawt.dll" file appears to be in the path, it won't work. I even tried copying "jawt.dll" from my jre's bin directory into the library's "windows_native" directory and it still won't work. –  May 28 '15 at 19:25
  • The library file I am using is "libjitsi-613-x64.zip". You can get it from https://download.jitsi.org/libjitsi/windows/. I have tried using Netbeans and Eclipse. In Eclipse under "Run Configuration" I specify VM arguments as -Djava.library.path=/path/to/library/dll/files. In Netbeans I go to Project Properties > Run. The java version I am using is jdk1.8.0_31. I am sure that I am using 64 bit Java with the 64 bit version of this library. Can anyone duplicate this error? –  May 28 '15 at 19:45

0 Answers0