jshell --enable-preview --execution=local bug?
Jan Lahoda
jan.lahoda at oracle.com
Wed May 17 17:41:30 UTC 2023
Hi Max,
I've filled:
https://bugs.openjdk.org/browse/JDK-8308305
Thanks for the report.
Jan
On 17. 05. 23 0:52, Max Rydahl Andersen wrote:
>
> Hi,
>
> As part of adding |--enable-preview| support to JBang 0.107
> <https://github.com/jbangdev/jbang/releases/tag/v0.107.0> I spotted
> this discrepancy in jshell behaviour. Is this to be expected or a bug?
>
> First what is expected right behaviour:
>
> |$ jshell --enable-preview | Welcome to JShell -- Version 21-ea | For
> an introduction type: /help intro jshell> var name="test";
> STR."\{name} test"; name ==> "test" $2 ==> "test test" jshell>
> $2.length(); $3 ==> 9 |
>
> but now when running with |--execution=local|:
>
> |jshell --enable-preview --execution=local | Welcome to JShell --
> Version 21-ea | For an introduction type: /help intro jshell> var
> name="test"; STR."\{name} test"; name ==> "test" $2 ==> jshell>
> $2.length(); | Exception java.lang.UnsupportedClassVersionError:
> Preview features are not enabled for REPL/$JShell$12 (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 (#3:1) |
>
> I found that by duplicating |--enable-preview| in runtime options
> fixes things:
>
> |$ jshell --enable-preview --execution=local -J--enable-preview |
> Welcome to JShell -- Version 21-ea | For an introduction type: /help
> intro jshell> var name="test"; STR."\{name} test"; name ==> "test" $2
> ==> "test test" jshell> $2.length(); $3 ==> 9 |
>
> Seems like a bug to me, wdyt? and where to open/report this best or is
> it enough here?
>
> /max
> https://xam.dk/about
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/kulla-dev/attachments/20230517/fc4f1d9d/attachment-0001.htm>
More information about the kulla-dev
mailing list