Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional jigsaw flags support #826

Merged
merged 2 commits into from
Jun 22, 2021
Merged

Conditional jigsaw flags support #826

merged 2 commits into from
Jun 22, 2021

Conversation

tresf
Copy link
Contributor

@tresf tresf commented Jun 14, 2021

Re-ables dark mode on JDK16+ since #822

Closes #824

@klabarge
Copy link
Member

On Windows 10, AOJDK16, using this installer I am unable to interact with the tray icon.

I don't see the Java >= 9.0, adding jigsaw options message like in macOS (which is working)

C:\Users\Kyle>java -Xms512M -jar "%PROGRAMFILES%\QZ Tray\qz-tray.jar"
[INFO] 2021-06-18 12:57:22,713 @ qz.ws.PrintSocketServer:?
        QZ Tray version: 2.1.3+7
[INFO] 2021-06-18 12:57:22,713 @ qz.ws.PrintSocketServer:?
        QZ Tray vendor: QZ Industries, LLC
[INFO] 2021-06-18 12:57:22,713 @ qz.ws.PrintSocketServer:?
        Java version: 16.0.1
[INFO] 2021-06-18 12:57:22,713 @ qz.ws.PrintSocketServer:?
        Java vendor: AdoptOpenJDK
[DEBUG] 2021-06-18 12:57:22,963 @ qz.common.TrayManager:?
        Skipping JDK-8266929 patch for 16.0.1
[INFO] 2021-06-18 12:57:23,135 @ qz.installer.certificate.CertificateManager:?
        Try to find SSL properties file...
[INFO] 2021-06-18 12:57:23,291 @ qz.installer.certificate.CertificateManager:?
        Found C:\Program Files\QZ Tray/qz-tray.properties
[DEBUG] 2021-06-18 12:57:23,291 @ qz.utils.ShellUtilities:?
        Executing: [net, session]
[INFO] 2021-06-18 12:57:23,510 @ qz.installer.certificate.CertificateManager:?
        Wrote Cert: "C:\Users\Kyle\AppData\Local\Temp\root-ca-809717973841259901.crt"
[INFO] 2021-06-18 12:57:23,525 @ qz.installer.certificate.WindowsCertificateInstaller:?
        Opening USER store using Crypt32...
[DEBUG] 2021-06-18 12:57:23,541 @ qz.installer.certificate.CertificateManager:?
        Parsed hostNames: localhost, localhost.qz.io
[INFO] 2021-06-18 12:57:23,557 @ qz.installer.certificate.CertificateManager:?
        Email address support@qz.io found, assuming CertProvider is INTERNAL
[DEBUG] 2021-06-18 12:57:23,557 @ qz.utils.ShellUtilities:?
        Executing: [CheckNetIsolation.exe, LoopbackExempt, -a, -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe]
[INFO] 2021-06-18 12:57:23,686 @ qz.ws.PrintSocketServer:?
        Starting QZ Tray 2.1.3+7
[WARN] 2021-06-18 12:57:23,787 @ qz.auth.Certificate:?
        Failed to retrieve QZ CRL, skipping CRL check
[DEBUG] 2021-06-18 12:57:23,790 @ qz.auth.Certificate:?
        Adding internal CA certificate: CN=qzindustries.com, O=QZ Industries, LLC (8ef2c0b2fe3f75754245b3fb9d54c0caa1b46bb3)
[INFO] 2021-06-18 12:57:23,794 @ qz.auth.CRL:?
        Loading CRL from https://crl.qz.io
[TRACE] 2021-06-18 12:57:24,005 @ qz.utils.ConnectionUtilities:?
        User agent string for URL requests:

Sec-CH-UA-Full-Version: 2.1.3+7
Sec-CH-UA-Platform-Version: 10.0
Sec-CH-UA: "QZ Tray"; v="2.1.3+7", "Java"; v="16.0.1"
Sec-CH-UA-Platform: Windows
User-Agent: Mozilla/5.0 (Windows NT 10.0; x86_64) QZTray/2.1.3 Java/16
Sec-CH-UA-Arch: x86
Sec-CH-UA-Bitness: 64

[INFO] 2021-06-18 12:57:24,691 @ qz.auth.CRL:?
        Successfully loaded 4 CRL entries from https://crl.qz.io
[DEBUG] 2021-06-18 12:57:25,552 @ qz.utils.FileUtilities:?
        Checking for .autostart preference in user directory C:\Users\Kyle\AppData\Roaming\qz...
[DEBUG] 2021-06-18 12:57:25,555 @ qz.utils.FileUtilities:?
        Checking for .autostart preference in shared directory C:\ProgramData\qz...
[TRACE] 2021-06-18 12:57:25,784 @ qz.ws.PrintSocketServer:?
        Established secure WebSocket on port 8181
[INFO] 2021-06-18 12:57:26,341 @ qz.ws.PrintSocketServer:?
        Server started on port(s) 8182, 8181
[DEBUG] 2021-06-18 12:57:26,350 @ qz.ws.SingleInstanceChecker:?
        Checking for a running instance of QZ Tray on port 8283
[DEBUG] 2021-06-18 12:57:26,729 @ qz.ws.SingleInstanceChecker:?
        Checking for a running instance of QZ Tray on port 8384
[DEBUG] 2021-06-18 12:57:26,931 @ qz.ws.SingleInstanceChecker:?
        Checking for a running instance of QZ Tray on port 8485
[TRACE] 2021-06-18 12:57:27,461 @ qz.common.AboutInfo:?
        Found latest version: 2.1.3
Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class com.bulenkov.darcula.ui.DarculaMenuItemUIBase (in unnamed module @0x1da51a35) cannot access class sun.swing.MenuItemLayoutHelper (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x1da51a35
        at com.bulenkov.darcula.ui.DarculaMenuItemUIBase.paintMenuItem(DarculaMenuItemUIBase.java:137)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:621)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:617)
        at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:797)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5271)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
        at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
        at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
        at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:75)
        at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:112)
        at java.desktop/java.awt.Container.paint(Container.java:2003)
        at java.desktop/java.awt.Window.paint(Window.java:3949)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
        at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
        at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1884)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: class com.bulenkov.darcula.ui.DarculaMenuItemUIBase (in unnamed module @0x1da51a35) cannot access class sun.swing.MenuItemLayoutHelper (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x1da51a35
        at com.bulenkov.darcula.ui.DarculaMenuItemUIBase.paintMenuItem(DarculaMenuItemUIBase.java:137)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.paint(BasicMenuItemUI.java:621)
        at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.update(BasicMenuItemUI.java:617)
        at java.desktop/javax.swing.JComponent.paintComponent(JComponent.java:797)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
        at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
        at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
        at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5271)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(RepaintManager.java:1643)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1618)
        at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
        at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
        at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
        at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
        at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:75)
        at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:112)
        at java.desktop/java.awt.Container.paint(Container.java:2003)
        at java.desktop/java.awt.Window.paint(Window.java:3949)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
        at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
        at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
        at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
        at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1884)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

@tresf
Copy link
Contributor Author

tresf commented Jun 21, 2021

I don't see the Java >= 9.0, adding jigsaw options message like in macOS (which is working)

Right, because on Mac and Linux, those are added by the shell script launcher, which is done a bit differently (and thus silent) on Windows.

Mac/Linux: (i.e. QZ Tray shell script)

else
echo -e "$SUCCESS Java >= 9.0, adding jigsaw options"
LAUNCH_OPTS="$LAUNCH_OPTS ${launch.jigsaw}"

Windows: (i.e. qz-tray.exe launcher)

; Handle jdk9+ flags
${If} $java_major >= 9
StrCpy $opts "${launch.opts} ${launch.jigsaw}"
${EndIf}

On Windows 10, AOJDK16, using this installer I am unable to interact with the tray icon.

Thanks, I must have made a mistake somewhere for the Windows launcher, checking now...

@tresf
Copy link
Contributor Author

tresf commented Jun 21, 2021

Windows installer patched via 9cd6837. Windows installer re-uploaded. @klabarge can you re-test Windows?

@tresf tresf requested a review from klabarge June 21, 2021 16:23
@klabarge
Copy link
Member

Windows installer patched via 9cd6837. Windows installer re-uploaded. @klabarge can you re-test Windows?

@tresf I'm still getting the same Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: error with the 2.1.3+7b installer

@klabarge
Copy link
Member

Windows installer patched via 9cd6837. Windows installer re-uploaded. @klabarge can you re-test Windows?

@tresf I'm still getting the same Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: error with the 2.1.3+7b installer

This patch worked. I was testing via the cmd prompt and was not using the new launch syntax (below).

java -Xms512M --add-exports java.desktop/sun.swing=ALL-UNNAMED -jar "%PROGRAMFILES%\QZ Tray\qz-tray.jar"

This is ready to merge.

AOJDK8 AOJDK11 AOJDK16
macOS
Windows
Ubuntu

@tresf tresf merged commit aca87ff into master Jun 22, 2021
@tresf tresf deleted the jdk16b branch June 22, 2021 15:51
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.

Dark mode not available JDK16+
2 participants