[ jEdit-devel ] [jedit:bugs] #3971 Exception trying to set X11 WM_CLASS in JDK9 on Linux

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ jEdit-devel ] [jedit:bugs] #3971 Exception trying to set X11 WM_CLASS in JDK9 on Linux

will69

[bugs:#3971] Exception trying to set X11 WM_CLASS in JDK9 on Linux

Status: open
Group: minor bug
Labels: JDK9
Created: Tue Mar 29, 2016 12:25 PM UTC by will69
Last Updated: Tue Mar 29, 2016 12:25 PM UTC
Owner: nobody

JDK9 includes modules since jdk-9-ea+111. There is an exception when trying to set X11 WM_CLASS (aka x11.wmclass) to "jedit" on Linux via reflection. Luckily, jEdit still starts. The culprit is the call to setAccessible. As a consequence, X11 window class names will be different with JDK9, as seen by calling xprop | grep WM_CLASS:

JDK8: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"
JDK9: WM_CLASS(STRING) = "org-gjt-sp-jedit-jEdit", "org-gjt-sp-jedit-jEdit"

Setting that value in the first place was requested here. There does not seem to be any other way to set it. Throwing an exception on startup should be avoided.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ jEdit-devel ] [jedit:bugs] #3971 Exception trying to set X11 WM_CLASS in JDK9 on Linux

will69

Since this is an expected behavior on JDK9, the startup exception should be eliminated by inserting

if(!"java.lang.reflect.InaccessibleObjectException".equals(e.getClass().getName()))

before the call to Log.log or at least the log message should be clarified ("Cannot set X11 WM_CLASS to \"jedit\"").


[bugs:#3971] Exception trying to set X11 WM_CLASS in JDK9 on Linux

Status: open
Group: minor bug
Labels: JDK9
Created: Tue Mar 29, 2016 12:25 PM UTC by will69
Last Updated: Tue Mar 29, 2016 12:25 PM UTC
Owner: nobody

JDK9 includes modules since jdk-9-ea+111. There is an exception when trying to set X11 WM_CLASS (aka x11.wmclass) to "jedit" on Linux via reflection. Luckily, jEdit still starts. The culprit is the call to setAccessible. As a consequence, X11 window class names will be different with JDK9, as seen by calling xprop | grep WM_CLASS:

JDK8: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"
JDK9: WM_CLASS(STRING) = "org-gjt-sp-jedit-jEdit", "org-gjt-sp-jedit-jEdit"

Setting that value in the first place was requested here. There does not seem to be any other way to set it. Throwing an exception on startup should be avoided.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ jEdit-devel ] [jedit:bugs] #3971 Exception trying to set X11 WM_CLASS in JDK9 on Linux

will69
In reply to this post by will69

The exception can be eliminated by adding the following command line option on JDK9:

-XaddExports:java.desktop/sun.awt.X11=ALL-UNNAMED

This breaks the access-control boundaries defined by the module system. See also JDK-8061972.

xprop | grep WM_CLASS then yields:

WM_CLASS(STRING) = "jedit", "jedit"

Thus, the above command line option should be added when running on JDK9.


[bugs:#3971] Exception trying to set X11 WM_CLASS in JDK9 on Linux

Status: open
Group: minor bug
Labels: JDK9
Created: Tue Mar 29, 2016 12:25 PM UTC by will69
Last Updated: Tue Mar 29, 2016 12:36 PM UTC
Owner: nobody

JDK9 includes modules since jdk-9-ea+111. There is an exception when trying to set X11 WM_CLASS (aka x11.wmclass) to "jedit" on Linux via reflection. Luckily, jEdit still starts. The culprit is the call to setAccessible. As a consequence, X11 window class names will be different with JDK9, as seen by calling xprop | grep WM_CLASS:

JDK8: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"
JDK9: WM_CLASS(STRING) = "org-gjt-sp-jedit-jEdit", "org-gjt-sp-jedit-jEdit"

Setting that value in the first place was requested here. There does not seem to be any other way to set it. Throwing an exception on startup should be avoided.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[ jEdit-devel ] [jedit:bugs] #3971 Exception trying to set X11 WM_CLASS in JDK9 on Linux

will69
In reply to this post by will69

The syntax has been changed twice. First to

--add-exports=java.desktop/sun.awt.X11=ALL-UNNAMED

and now (around Java 9-ea+149) to

--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED

[bugs:#3971] Exception trying to set X11 WM_CLASS in JDK9 on Linux

Status: open
Group: minor bug
Labels: JDK9
Created: Tue Mar 29, 2016 12:25 PM UTC by will69
Last Updated: Fri Apr 08, 2016 08:13 AM UTC
Owner: nobody

JDK9 includes modules since jdk-9-ea+111. There is an exception when trying to set X11 WM_CLASS (aka x11.wmclass) to "jedit" on Linux via reflection. Luckily, jEdit still starts. The culprit is the call to setAccessible. As a consequence, X11 window class names will be different with JDK9, as seen by calling xprop | grep WM_CLASS:

JDK8: WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "jedit"
JDK9: WM_CLASS(STRING) = "org-gjt-sp-jedit-jEdit", "org-gjt-sp-jedit-jEdit"

Setting that value in the first place was requested here. There does not seem to be any other way to set it. Throwing an exception on startup should be avoided.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Loading...