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

JDK11 Support #402

Closed
tresf opened this Issue Jan 21, 2019 · 8 comments

Comments

Projects
None yet
3 participants
@tresf
Copy link
Contributor

commented Jan 21, 2019

Oracle is making some EOL announcements for Java 8. Although originally targeted at Oracle Java SE 8 JDK, the information pages are quite unclear about this.

To clear the air, we should move the codebase to Java 11 ASAP. The biggest hurdle will be packaging JavaFX, which has since been removed from Java 11.

Note, Java 9 and Java 10 are EOL already because they don't carry an "LTS" (long term support) tag.

PR opened #407

@tresf tresf added the help wanted label Jan 21, 2019

@tresf tresf added this to the 2.2 milestone Jan 21, 2019

@onurguzel

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2019

After manually installing JavaFX, I was able to compile QZ Tray with Java 11 for both 2.0 and 2.1 branches. When I launch (on macOS), icon is shown in the tray area, but also throws this exception:

This version of Mac OS X does not support the Apple EAWT.  ApplicationEvent handling has been disabled (java.lang.ClassNotFoundException: com.apple.eawt.ApplicationListener)
OSXAdapter could not access the About Menu
java.lang.NoSuchMethodException: com.apple.eawt.Application.setEnabledAboutMenu(boolean)
	at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476)
	at com.apple.OSXAdapter.setAboutHandler(Unknown Source)
	at qz.utils.MacUtilities.registerAboutDialog(Unknown Source)
	at qz.common.TrayManager.addMenuItems(Unknown Source)
	at qz.common.TrayManager.<init>(Unknown Source)
	at qz.ws.PrintSocketServer.lambda$main$0(Unknown Source)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
	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(Native Method)
	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

This comment has been minimized.

Copy link
Contributor Author

commented Jan 22, 2019

We add some event listeners to get some Apple-specific features (e.g About dialog from native menu bar).

For now we can put Java version detection (or class detection) around these so that it will safely load.

@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2019

@onurguzel QZ Tray with Java 11 is working just fine for me minus the Mac integration and the JavaFX library. The desktop integration appears to have changed: http://openjdk.java.net/jeps/272

We'd be willing to put a bounty on the integration features but they appear benign for now.

@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2019

For anyone testing against 2.0, please delete tray/lib/jre/jfxrt.jar before attempting to run.

There appears to be a bug with javafx11 on Windows. If the bin folder is not added to the path, it'll crash with Graphics Device initialization failed for : d3d, sw Error initializing QuantumRenderer: no suitable pipeline found. We'll need to find a way to add this dynamically at runtime so that we can still launch from console.

For now, a workaround in IntelliJ is to add PATH=./lib/javafx/bin to the Environmental Variables in IntelliJ.

Windows:

  • Download JavaFX from Gluon
  • Extract the DLLs from the bin folder to tray/lib/javafx/bin
  • Extract the JARs from the lib folder to tray/lib/javafx

@tresf tresf referenced this issue Jan 31, 2019

Merged

Initial JDK11 support #407

8 of 8 tasks complete
@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Jan 31, 2019

Moved checklist to #407. This PR is in really good shape and ready for testing.

@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Feb 1, 2019

@onurguzel FYI, access violations should be handled 3c23ec5.

@tresf tresf closed this in #407 Feb 2, 2019

@onurguzel

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2019

Thanks for the update, I will compile the latest to see if it is working fine.

@tresf tresf reopened this Feb 11, 2019

@tresf

This comment has been minimized.

Copy link
Contributor Author

commented Feb 11, 2019

Reopening. The build logic needs to be improved. It assumes the platform it's building on is the platform that's being targeted, but we build Windows on Linux, etc. This breaks a few areas in the build.xml logic and will need to be reworked.

@tresf tresf closed this in #419 Feb 26, 2019

tresf added a commit that referenced this issue Feb 26, 2019

Fix cross-platform javafx bundling
Fixes issue where (e.g. make nsis) on mac or linux would bundle the wrong JavaFX libraries.  Closes #402 (again)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.