Jajuk Advanced Jukebox

Follow us on GitHub

Go back to the TOC


How to get D-Bus working

D-Bus for Jajuk is provided by the open source library for D-Bus binding for Java and a few additional .jar files that are used by this library. Most of the setup is done “behind the scenes”, if you are using a Unix-like operating system that uses a X-Window Manager with support for D-Bus, it should work out of the box. During startup, Jajuk tries to establish a connection to the D-Bus session daemon to provide it’s interfaces to all applications running in the same session.

Remote control

The following applications allow to test controlling Jajuk remotely, “dbus-send” and “qdbus” can also be used to create scripts that control Jajuk, i.e. integration in LIRC or other systems:

dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport  /JajukDBus org.jajuk.services.dbus.DBusSupport.next

KDE has also support for linking dbus-actions to keyboard shortcuts in the system settings dialogs for keyboard shortcuts, see bellow for details.

Native library

$JAVA_BIN $JAVA_OPTIONS -Djava.library.path=$JAJUK_HOME/../lib -jar jajuk.jar $JAJUK_OPTIONS


Cannot Resolve Session Bus Address

During startup the Error “Cannot Resolve Session Bus Address” is reported and DBus-support does not work. The logfile will show the following:

2009/05/22 08:58:41 [INFO] Trying to start support for D-Bus on Linux with Bus:   
[Startup Async After Collection Load Thread] (Log.java:148) 
2009/05/22 08:58:41 [ERROR] Cannot Resolve Session Bus Address / null 
[Startup Async After Collection Load Thread] (Log.java:276) 
org.freedesktop.dbus.exceptions.DBusException: Cannot Resolve Session Bus Address
	at org.freedesktop.dbus.DBusConnection.getConnection(Unknown Source)
	at org.jajuk.services.dbus.DBusSupportImpl.connect(DBusSupportImpl.java:75)
	at org.jajuk.services.dbus.DBusManager.<init>(DBusManager.java:48)
	at org.jajuk.services.dbus.DBusManager.getInstance(DBusManager.java:38)
	at org.jajuk.services.core.StartupService$2.run(StartupService.java:258)


In order to access the D-Bus session-wide bus, the D-Bus libraries use an environment variable DBUS_SESSION_BUS_ADDRESS which is set by the dbus-startup scripts. Ensure that this environment variable is available. E.g. check the output of the following command:

set | grep DBUS

It should print out something like:


If this environment variable is not set, ensure that the d-bus support is started correctly in your operating system configuration/installation.

Appendix: Using xbindkeys to enable multimedia keys to control Jajuk
"amixer -q set PCM 5%+ unmute"

"amixer -q set PCM 5%- unmute"

"amixer -q set Master toggle"

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.next"

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.previous"

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.stop"

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.playPause"

Just starting xbindkeys at the startup maps the keys and allows to use the multimedia keys for controlling Jajuk. The following will add key-combinations for non-audio keyboards, in this case CTRL-ALT-B for _ban_and CTRL-ALT-N for ”show currently playing”:

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.banCurrent"
   m:0xc + c:56
   Control+Alt + b 

"dbus-send --session --print-reply --dest=org.jajuk.dbus.DBusSupport /JajukDBus org.jajuk.services.dbus.DBusSupport.showCurrentlyPlaying"
   m:0xc + c:57
   Control+Alt + n

Appendix: How to configure key combinations for D-Bus in KDE

Go back to the TOC