Java ATK Wrapper


Java ATK Wrapper is a implementation of ATK by using JNI technic. It converts Java Swing events into events which ATK can understand and then sends these events to ATK-Bridge. Order of the java stack down to ATK is Java Application > JRE JAAPI > JAW > ATK and JAW consists of two major parts:

The Java library that listens to Swing events, and adapting JAAPI to fit the interfaces of ATK

The C library that converts Swing events into GSignals and talks to ATK-Bridge.

Getting Started

Download and Install

The java-atk-wrapper source code is hosted by GNOME

git clone git://

Then enter the install root directory using the cd command and run the script to install:

cd java-atk-wrapper
./ --prefix=/opt/gnome && make && make install

{i} You may wish to set a prefix to avoid permission errors while building (e.g. ./ --prefix=/opt/gnome && make && make install)

As the compiler is set to fail on warnings by default. If the compilation fails try compiling with:

cd java-atk-wrapper
./ --enable-compile-warnings=no && make && make install

Run a java program with the wrapper

To run with a java application (e.g. SwingSet2)

java -jar -Dassistive_technologies=org.GNOME.Accessibility.AtkWrapper SwingSet2.jar


SwingSet2 is traditionally used to test java accessibility. However, it is a little out of date with deprecated functions, unchecked operations and accessible information which is not always complete. Work is being done on a SwingSet fork to ensure that testing is more comprehensive and up to date. To get hold of that version of SwingSet, type the following into the terminal from an appropriate working directory:

git clone

Compile the java classes:

cd SwingSet3; javac *.java

Build SwingSet2.jar with:

jar cvmf META-INF/MANIFEST.MF SwingSet3.jar *.class resources

To get debugging information, add the -verbose:jni flag when running SwingSet with the wrapper:

java -jar -Dassistive_technologies=org.GNOME.Accessibility.AtkWrapper -verbose:jni SwingSet3.jar

The wrapper can be tested using some example pyatspi python scripts or with Accerciser, the accessibility testing tool for GNOME.

Making changes

After making any changes to the wrapper, it's very important to make sure that the build and install are clean before testing or the new change will not be updated when the wrapper is reinstalled.

To remove the system installed files like java-atk-wrapper.jar, and the libatk-wrapper.* files run:

make uninstall

To remove the files generated in the build directory by ./configure use

make clean

To clean gitignored files but leave any untracked files which you may be working on run:

git clean -fdX


Firstly, run a program like SwingSet2 then to check SwingSet2's PID, run the following command:

ps -ef | grep SwingSet2

This reveals a number called the PID which is associated to the running SwingSet2 application. The application can be attached to a gdb session using its PID, as follows:

gdb attach $PID

A bunch of debugging symbols get read until a gdb prompt appears. At the prompt we can tell gdb to stop and create a breakpoint at the first sign of trouble:

(gdb) b g_log

Before we can start properly debugging, we need the application to continue on as normal. The command for that is cont:

(gdb) cont

Now we can return to the running SwingSet2 application to test some functionality until we see a problem and the (gdb) prompt appears to indicate that a breakpoint was created. At the prompt we can get a trace to see what the problem is:

(gdb) bt


All bugs must be filed against Java ATK Wrapper in Bugzilla and patches must be submitted to the appropriate bug report for review.

GNOME's bugzilla also provides a full list of open Java ATK Wrapper bugs.


Please direct user support questions to gnome-accessibility-list and technical questions to gnome-accessibility-devel.

This module is maintained by Magdalen Berns.


Accessibility/JavaAtkWrapper (last edited 2015-07-19 18:11:53 by MagdalenBerns)