<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Compiling a Java D-Bus program - Revision history</title>
		<link>https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.34.1</generator>
		<lastBuildDate>Tue, 09 Jun 2026 18:08:27 GMT</lastBuildDate>
		<item>
			<title>Bech: Category:Documentation in English</title>
			<link>https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=32895&amp;oldid=prev</link>
			<guid isPermaLink="false">https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=32895&amp;oldid=prev</guid>
			<description>&lt;p&gt;Category:Documentation in English&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 11:29, 24 March 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;[[Category:Development]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;[[Category:Documentation in English]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 24 Mar 2012 11:29:36 GMT</pubDate>
			<dc:creator>Bech</dc:creator>
			<comments>https://wiki.apertium.org/wiki/Talk:Compiling_a_Java_D-Bus_program</comments>
		</item>
		<item>
			<title>Wynand.winterbach: Moved this out from D-Bus_examples</title>
			<link>https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=3113&amp;oldid=prev</link>
			<guid isPermaLink="false">https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=3113&amp;oldid=prev</guid>
			<description>&lt;p&gt;Moved this out from D-Bus_examples&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;Read the guide to [[Installing_the_Java_D-Bus_bindings|installing the Java D-Bus bindings]] if you don&amp;#039;t have the library installed already.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Since both D-Bus and Java use statically typed systems, Java needs to have the D-Bus interface descriptions of the objects it will use available at compile time. The &amp;#039;CreateInterface&amp;#039; program in the Java D-Bus distribution creates Java interfaces by introspecting D-Bus objects.&lt;br /&gt;
&lt;br /&gt;
We will create a Java interface corresponding to the info.apertium.Info interface and we will store it under the file org/apertium/Info.java. To do this, execute:&lt;br /&gt;
&amp;lt;pre&amp;gt;CreateInterface org.apertium.info / &amp;gt; org/apertium/Info.java&amp;lt;/pre&amp;gt;&lt;br /&gt;
(and remember to use &amp;lt;code&amp;gt;dbus-launch --exit-with-session&amp;lt;/code&amp;gt; if this does not work).&lt;br /&gt;
&lt;br /&gt;
The contents out the newly created file should look something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* File: org/apertium/Info.java */&lt;br /&gt;
package org.apertium;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
import org.freedesktop.dbus.DBusInterface;&lt;br /&gt;
public interface Info extends DBusInterface&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
  public String directory();&lt;br /&gt;
  public List&amp;lt;List&amp;lt;String&amp;gt;&amp;gt; get_pipeline(String mode);&lt;br /&gt;
  public List&amp;lt;String&amp;gt; get_filters(String _type);&lt;br /&gt;
  public List&amp;lt;String&amp;gt; modes();&lt;br /&gt;
  public String mode_directory();&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step is to create our minimal Java program. Create a file called &amp;lt;code&amp;gt;TestDBus&amp;lt;/code&amp;gt; with the following contents:&lt;br /&gt;
{{Java D-Bus snippet}}&lt;br /&gt;
&lt;br /&gt;
To compile this program, we need to include the current path on the class path as well as the jar files needed by the Java D-Bus binding. To compile, execute (you should modify the directories to suit your installation): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
javac -cp .:/usr/local/share/java/dbus.jar:/usr/local/share/java/unix.jar:\&lt;br /&gt;
/usr/local/share/java/debug-disable.jar  TestDBus.java&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the program, you need to specify the class paths specified above, as well as the JNI code (which installs to &amp;lt;code&amp;gt;/usr/local/lib/jni&amp;lt;/code&amp;gt; by default (if you are using TCP instead of UNIX domain sockets for transport, then this won&amp;#039;t be needed). You can run the program using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
java -cp .:/usr/local/share/java/dbus.jar:\&lt;br /&gt;
/usr/local/share/java/unix.jar:/usr/local/share/java/debug-disable.jar\&lt;br /&gt;
-Djava.library.path=/usr/local/lib/jni TestDBus&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(and if it does not work, prefix the command with &amp;lt;code&amp;gt;dbus-launch --exit-with-session&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Of course, if you are writing an application, you would hide all of these flags in a wrapper script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</description>
			<pubDate>Wed, 19 Dec 2007 12:55:32 GMT</pubDate>
			<dc:creator>Wynand.winterbach</dc:creator>
			<comments>https://wiki.apertium.org/wiki/Talk:Compiling_a_Java_D-Bus_program</comments>
		</item>
</channel></rss>