Review request for 8139508 Debug option does not work in appletviewer
mandy.chung at oracle.com
Tue Oct 13 16:18:50 UTC 2015
> On Oct 13, 2015, at 7:00 AM, Alan Bateman <alan.bateman at oracle.com> wrote:
> On 13/10/2015 14:33, Alexander Scherbatiy wrote:
>> Could you review the fix:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8139508
>> webrev: http://cr.openjdk.java.net/~alexsch/8139508/webrev.00
>> This is the fix for the appletviewer which can't start the debugger with the jake build.
>> - jdk.jdi module exports com.sun.tools.example.debug.tty to java.desktop module
>> - appletviewer is run with -addmods jdk.jdi option
>> - sun.applet.Main adds a read edge to the jdk.jdi module
> I wonder how often appletviewer -debug is used these days. Would anyone notice if that option was removed?
> The issue with "-addmods jdk.jdi" is that appletviewer won't start on a runtime that doesn't have module jdk.jdi (try it with a JRE build for example).
> If -debug is really needed going forward then possible approaches to consider are:
> 1. A special appletviewer launcher that handles -debug and translates it to "-addmods jdk.jdi" by setting the corresponding system property.
> 2. Change it to "-addmods ALL-SYSTEM". The "ALL-SYSTEM" token doesn't exist at this time but there are cases where the initial module is a container that launches other applications that might needs have dependences of any of the system modules. If appletviewer is running random applets then I expect it will need this anyway.
> There is a 3rd option, to have the appletviewer launcher not use -m, but that only works by accident and I'm sure in time that it will be caught as an error.
There are other cases that need to add a module to the root set. For example -Dcom.sun.management.jmxremote is enables JVM monitoring and management that requires java.management module. When launching a modular application with -Dcom.sun.management.jmxremote, it would need java.management module to be included in the boot layer and #1 is a reasonable approach as launcher is the one handling the options that add additional module dependency.
More information about the jigsaw-dev