Skip to content

from java import * not working in Java 21 #304

@benken-parasoft

Description

@benken-parasoft

Issue 105 is happening again but this time in Java 21.

This works in Java 17 but not Java 21:

from java.util import *
d = Date()

In Java 21, this results in:

NameError: global name 'Date' is not defined

In Java 21, I have to use "from java.util import Date" instead of "from java.util import *".
This problem happens with "import *" from other "java" packages as well, not just "java.util".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions