<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Compiling_a_Java_D-Bus_program</id>
	<title>Compiling a Java D-Bus program - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Compiling_a_Java_D-Bus_program"/>
	<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;action=history"/>
	<updated>2026-05-05T16:00:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=32895&amp;oldid=prev</id>
		<title>Bech: Category:Documentation in English</title>
		<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=32895&amp;oldid=prev"/>
		<updated>2012-03-24T11:29:36Z</updated>

		<summary type="html">&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;</summary>
		<author><name>Bech</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=3113&amp;oldid=prev</id>
		<title>Wynand.winterbach: Moved this out from D-Bus_examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Compiling_a_Java_D-Bus_program&amp;diff=3113&amp;oldid=prev"/>
		<updated>2007-12-19T12:55:32Z</updated>

		<summary type="html">&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;</summary>
		<author><name>Wynand.winterbach</name></author>
		
	</entry>
</feed>