Using java.awt.Toolkit.getDefaultToolkit().getScreenSize() reflectively causes InaccessibleObjectException
Alan Bateman
Alan.Bateman at oracle.com
Fri Jan 6 12:57:19 UTC 2017
On 06/01/2017 12:26, Rony G. Flatscher wrote:
> Alan,
>
> thank you for your pointer.
>
> The code shown in [1] currently needs to access Java 9 features (to test whether the module is
> exported), which might not be a possibility for Java libraries that have a baseline like Java 1.4
> (the GA version of the Java bridge is at that level) or 1.6 (the current beta version of the Java
> bridge raises the baseline to 1.6, which depends on the deployed Java runtimes; businesses hardly
> update to a newer level for a proved and stable running application system, where Java developers
> love to be on the latest version).
Two features to be aware that can help with scenarios like this are:
JEP 238: Multi-Release JAR Files [1]
JEP 247: Compile for Older Platform Versions [2]
-Alan
[1] http://openjdk.java.net/jeps/238
[2] http://openjdk.java.net/jeps/247
More information about the jigsaw-dev
mailing list