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

jshell --enable-preview --execution=local does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 17, 18, 19, 20, 21
    • tools
    • None

      As noted here:
      https://mail.openjdk.org/pipermail/kulla-dev/2023-May/004236.html

      --enable-preview and --execution=local do not work well together:

      $ jshell --enable-preview --execution=local
      | Welcome to JShell -- Version 21-internal
      | For an introduction type: /help intro

      jshell> var v = STR.""
      v ==>

      jshell> v.toString()
      | Exception java.lang.UnsupportedClassVersionError: Preview features are not enabled for REPL/$JShell$189 (class file version 65.65535). Try running with '--enable-preview'
      | at ClassLoader.defineClass1 (Native Method)
      | at ClassLoader.defineClass (ClassLoader.java:1018)
      | at SecureClassLoader.defineClass (SecureClassLoader.java:150)
      | at DefaultLoaderDelegate$RemoteClassLoader.findClass (DefaultLoaderDelegate.java:156)
      | at ClassLoader.loadClass (ClassLoader.java:593)
      | at ClassLoader.loadClass (ClassLoader.java:526)
      | at (#2:1)

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: