devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
264 stars 62 forks source link

Loading native library in JNI #137

Closed greco-salvatore closed 8 months ago

greco-salvatore commented 8 months ago

Describe the bug && To Reproduce Hi all, i'm testing the features of the library and i imported the library from maven in a Java 8 project. So far so good, but when im launching a simple main it returns this:

...
Hello world!
Exception in thread "main" java.lang.UnsatisfiedLinkError: dev.onvoid.webrtc.media.audio.AudioDeviceModule.initialize(Ldev/onvoid/webrtc/media/audio/AudioLayer;)V
    at dev.onvoid.webrtc.media.audio.AudioDeviceModule.initialize(Native Method)
    at dev.onvoid.webrtc.media.audio.AudioDeviceModule.<init>(AudioDeviceModule.java:40)
    at Main.initFactory(Main.java:44)
    at Main.main(Main.java:21)

Process finished with exit code 1

Expected behavior the webrtc-java.dll contained in the maven library webrtc-java-0.8.0-windows-x86_64.jar is not found. For a workaround i extracted it manually in the root project an loaded it with System.loadLibrary("webrtc-java"); (this is OK). It is an expected behavior?

btw i'm using IntellJ 2023.1, from the project structure/library i can specify the dll only like classpath and not like native library path...

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

greco-salvatore commented 8 months ago

resolved