Skip to content

Fix "InaccessibleObjectException" exception on Linux startup - #1559

Merged
catilac merged 1 commit into
processing:mainfrom
neobrain:add-opens
Aug 5, 2026
Merged

Fix "InaccessibleObjectException" exception on Linux startup#1559
catilac merged 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.

@catilac catilac left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing, thank you for fixing this @neobrain !

@catilac
catilac merged commit 0d8bde5 into processing:main Aug 5, 2026
6 checks passed
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.

2 participants