Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8273281

jshell does not support the --enable-native-access option

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 18
    • tools
    • None
    • behavioral
    • minimal
    • add/remove/modify command line option
    • JDK

      Summary

      The --enable-native-access command line option is added to JShell.

      Problem

      JShell does not have the --enable-native-access command line option, so it is more difficult to experiment with methods that require it.

      Solution

      JShell will accept the --enable-native-access command line option. Unlike the runtime (java launcher) option, it will not accept any parameter. The motivation is that while JShell snippets run currently in an unnamed module, JShell does not advertise this fact. JShell generally does not rely on the user's knowledge of the module in which the snippets run. This is consistent with the existing --add-exports option, which also does not accept the target module, and only accepts the source module and package (--add-exports <module>/<package>).

      Specification

      JShell will have the --enable-native-access command line option, without parameters. This will enable the restricted methods for ordinary JShell snippets, by passing --enable-native-access=ALL-UNNAMED to the runner agent.

            jlahoda Jan Lahoda
            jrose John Rose
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: