I am looking at using d-bus from Scala. I have added this to my build.sbt
:
libraryDependencies ++= Seq(
...
"com.github.hypfvieh" % "dbus-java" % "3.0.2",
...
}
Building is find, but at runtime it can't find the UnixSocket
class:
java.lang.RuntimeException: Could not load library from any given source: [SYSTEM_PATH, CUSTOM_PATH, CLASS_PATH] at com.github.hypfvieh.system.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:89) at com.github.hypfvieh.system.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:69) at cx.ath.matthew.unix.UnixSocket.(UnixSocket.java:54)
I've tried various artefacts on Maven that might have this class, but without success.
Is there another dependency I should be using, or do I need to add the appropriate library by hand?
None of the (old) dbus-java classes/libraries are on Maven, those bindings never used Maven as the buildsystem. The original bindings can still be seen on the dbus git repo.
If you're on Debian, you should be able to get the libraries by running apt-get install libunixsocket-java
. If you are not on Debian or a Debian derivative, you would have to compile from source.
Note that however the error that is happening is actually due to you not loading the JNI code library, that code is actually in the dbus-java repo.