In JavaFx, I used PrinterJob to execute the following code, but an error (?) appeared and I couldn't print well (I couldn't open it in Google Chrome).
Please tell me the cause and solution.
Let's start with the contents of the error (not a warning).
I think the meaning is as follows.
An incorrect reflection from com.sun.prism.j2d.J2DFontFactory to sun.font.FontUtilities.getCompositeFontUIResource has occurred.If possible, please report to com.sun.prism.j2d.J2DFontFactory developer.Bad reflections will not work in full in the future, but now they act as "warns" by --illlegal-access=warn.
The warning was detailed on the Microsoft site.To quote.
We recommend that you configure the command-line option --illegal-access=warn. Java 11 generates a bad reflect access warning when accessing the JDK internal API using reflection. By default, warnings are issued only for the first rogue access. -- ilgal-access=warn generates a "warning" for each rogue reflex access. More cases will be found if the option is unauthorized access set to warn. However, many duplicate warnings are also displayed.
Once the application runs on Java 11, configure --illlegal-access=deny to mimic future Java runtime behavior. For Java 16 and later, the default value is --illlegal-access=deny.
Therefore, we recommend that you try the following conditions:
© 2022 OneMinuteCode. All rights reserved.