Skip to content

Fix "InaccessibleObjectException" exception on Linux startup - #1559

Open
neobrain wants to merge 1 commit into
processing:mainfrom
neobrain:add-opens
Open

Fix "InaccessibleObjectException" exception on Linux startup#1559
neobrain wants to merge 1 commit into
processing:mainfrom
neobrain:add-opens

Conversation

@neobrain

@neobrain neobrain commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Linux builds would previously throw this error on startup:

java.lang.reflect.InaccessibleObjectException: Unable to make field private
static java.lang.String sun.awt.X11.XToolkit.awtAppClassName accessible:
module java.desktop does not "opens sun.awt.X11" to unnamed module @4c8aea9c

The code that triggered this in Processing itself documented that an --add-opens parameter must be used, but this was never applied in the gradle build. This now matches the --add-opens parameter used in build/linux/processing.

Comment from LinuxPlatform.java:

// Set X11 WM_CLASS property which is used as the application
// name by Gnome 3 and other window managers.
// processing/processing#2534
// For Java 17, this hack requires an addition to the command line:
// --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED

Linux builds would previously throw this error on startup:
> java.lang.reflect.InaccessibleObjectException: Unable to make field private
> static java.lang.String sun.awt.X11.XToolkit.awtAppClassName accessible:
> module java.desktop does not "opens sun.awt.X11" to unnamed module @4c8aea9c

The code that triggered this in Processing itself documented that an
`--add-opens` parameter must be used, but this was never applied in the
gradle build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant