[SPAM?] Re: Accessing internal packages in JDK 9

Simon Nash simon at cjnash.com
Tue Jul 28 15:12:37 UTC 2015


mark.reinhold at oracle.com wrote:
> 2015/7/28 4:21 -0700, Simon Nash <simon at cjnash.com>:
>> ...
>>
>> With JDK 9 and Project Jigsaw, I understand that it will no longer be
>> possible for my application to directly reference internal sun.* classes.
>> Will it still be possible to use ClassLoader.loadClass to load these sun.*
>> classes and use reflection to invoke their methods?
> 
> Yes, but you'll have to use a command-line flag to make the classes
> accessible via the reflection API.
> 
> - Mark
> 
Is this a single option that enables all internal access or does the option
need to be repeated for every internal package or class that the application
needs to access?

If the option is set, can the application use imports for the internal
packages or is it required to access them reflectively?

Would it be possible to allow the application to set this option
programmatically on initialization or set it internally in some other way
(e.g., in its jar manifest) so that the users of the application don't need
to specify it on the launch command?

  Simon


More information about the jigsaw-dev mailing list