difference in behaviour with import module java.base

Archie Cobbs archie.cobbs at gmail.com
Tue Jun 24 17:37:18 UTC 2025


Hi Max,

On Sun, Jun 22, 2025 at 5:12 AM Max Rydahl Andersen <manderse at redhat.com>
wrote:

> I got reported a "fun" issue on jbang
> https://github.com/jbangdev/jbang/issues/2072 which boils down to the
> following calls to jshell behaving differently for reasons I can't really
> explain.
>

I'm having trouble reproducing this.

$ cat test.jsh
String[] args = { "arg1", "arg2" }
import static java.util.stream.Collectors.*;
import module java.base;
System.out.println(args.length);
/exit
$ java -version
openjdk version "25-ea" 2025-09-16
OpenJDK Runtime Environment (build 25-ea+26-3358)
OpenJDK 64-Bit Server VM (build 25-ea+26-3358, mixed mode, sharing)
$ jshell --enable-preview -J--enable-preview --startup=DEFAULT
--execution=local test.jsh
2
$

Does that test look correct? I'm running on Mac OS (Arm) and I tried with
23, 24, and 25-ea.

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/kulla-dev/attachments/20250624/7551f3be/attachment.htm>


More information about the kulla-dev mailing list