系統環境
Ubuntu 20.04 focal
問題分析
該異常出現的原因,從谷歌上可以得到答案
one of the more common causes of this exception is a missing or corrupt installation of a Java Access Bridge. In this case, the following access bridge has been defined in standard configuration file (JDK_HOME/jre/lib/accessibility.properties
):
com.sun.java.accessibility.AccessBridge
But it won't actually be operative unless the required installation is complete. Note that the standard access bridge implementation does not come packages with the SDK. To fix your particular issue, download and install the Oracle Access Bridge by following instructions from their setup page. That should resolve the startup error occurring in your program.
根據上述內容,我們可以在Oracle官網下載安裝這個 Java Access Bridge解決此問題,安裝說明 setup page.
當然,也可以直接禁用掉這個assistive technology,因此,最行之有效且方便的解決方案如下(對於通過apt安裝的openjdk而言):
文件
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/accessibility.properties
注釋掉
# assistive_technologies=org.GNOME.Accessibility.AtkWrapper