110
$ java -jar aprof-plot.jar
Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
    at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807)
    at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
    at java.awt.EventQueue.invokeLater(EventQueue.java:1264)
    at aprofplot.Main.newWindow(Main.java:33)
    at aprofplot.Main.main(Main.java:359)

Possible explanations I saw here was to install Java-access-bridge. But I am unable to install libaccess-java-bridge.

serv-inc
  • 3,159
  • 1
  • 26
  • 32

7 Answers7

200

I ran into this same error on my Ubuntu 15.10 server but did not want to install the non-headless version of OpenJDK due to the number of additional dependencies. A simpler solution was to simply disable assistive technologies.

This can be done by editing the accessibility.properties file for OpenJDK 8 (change the version to whichever is actually in use on your system):

sudo vim /etc/java-8-openjdk/accessibility.properties

Comment out the following line:

#assistive_technologies=org.GNOME.Accessibility.AtkWrapper

Also you can edit this line programmatically:

sudo sed -i -e '/^assistive_technologies=/s/^/#/' /etc/java-*-openjdk/accessibility.properties
David Foerster
  • 36,890
  • 56
  • 97
  • 151
rdrever
  • 2,101
39

Read the following thread. I managed to escape this problem by uninstalling OpenJDK 8 headless and installing OpenJDK 8.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798794

Commands I ran:

sudo dpkg -l | grep openjdk  

This is to verify you are actually running the headless version of JAVA, so no graph library available.

sudo apt-get remove openjdk-8-jre-headless

This is to remove headless version.

sudo apt-get install openjdk-8-jre

This is to install non-headless version of java.

14

For those who do not have root access on their machines to change the configuration file or do not want to install the full JRE: append -Djavax.accessibility.assistive_technologies=" " to your command, e.g.

$ java -jar aprof-plot.jar -Djavax.accessibility.assistive_technologies=" "

Do note that the " " is important, simply using "nothing" as parameter will cause the JRE to still load whatever is set in /etc/java-8-openjdk/accessibility.properties.

7

Same issue. In my case I couldn't run FastQC.
This is what I did:

$ sudo apt-get remove openjdk-11-jre-headless

I verified java was gone

$ java -version
bash: /usr/bin/java: No such file or directory
$ sudo apt-get install openjdk-8-jre

Problem solved.

abu_bua
  • 11,313
3

I had to uninstall openjdk-11-jre, eg:

sudo apt remove openjdk-11-jre

or

sudo apt remove openjdk-11*

to remove all openjdk-11 packages on your system.

This forces your program to run on openjdk-8-jre instead of openjdk-11-jre, as I had both installed. Apparently Java Assistive Technology doesn't run on the openjdk-11-jre package. I believe there is also a way to specify which Java version to run, but I don't know it off the top of my head and I'm sure there's another post on that topic.

3

Inspired from Marco's answer, but for me it only works in this order (prepending):

java -Djavax.accessibility.assistive_technologies=" " -jar aprof-plot.jar

It solved the problem and the program launched successfully (in my case argouml.jar fakesmtp.jar).

Using Java 8 on Ubuntu 2019.04

Nicolas Raoul
  • 11,921
0

This kind of error happens when you have a headless version of the JRE installed. The headless JRE is a subset of the full JRE but lacks GUI features, including support for assistive technologoes.

Install the full JRE (e.g. openjdk11-jre instead of openjdk11-jre-headless) and the error should go away. No need to uninstall the headless JRE.

user149408
  • 1,453
  • 4
  • 15
  • 30