Installing the Java D-Bus bindings
This is to help those who want to compile a Java program using Apertium's D-Bus services.
First you will need to download the D-Bus bindings for Java; the latest version can be found on the D-Bus project site. The bindings use libmatthew by the same author; the latest version can be downloaded from his site.
- Compile and install libmatthew.
- Compile and install the Java D-Bus bindings (ignore errors about invalid JAR paths - if it compiles and installs, everything will work.)
The Java binding build process should install the following binaries on your machine:
- CreateInterface
- DBusCall
- DBusDaemon
- DBusViewer
- ListDBus
You can make sure that everything works by executing:
DBusCall org.apertium.info / org.apertium.Info modes
If you get a message such as
ParseException: Bus address is blank
it means that the environment variable $DBUS_SESSION_BUS_ADDRESS isn't set. You can get around it by using dbus-launch --exit-with-session
to execute the program:
dbus-launch --exit-with-session DBusCall org.apertium.info / org.apertium.Info modes.
You should get output that looks something like this:
[[en-af, af-en]]
Now that the installation works, you might want to look at our guide to compiling Java D-Bus programs, using Apertium as an example.