Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from java import * not working in Java 21 #304

Closed
benken-parasoft opened this issue Feb 7, 2024 · 4 comments · Fixed by #306
Closed

from java import * not working in Java 21 #304

benken-parasoft opened this issue Feb 7, 2024 · 4 comments · Fixed by #306

Comments

@benken-parasoft
Copy link

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".

@benken-parasoft
Copy link
Author

I notice the build.xml references ASM 9.3 which supports Java 19.
I expect ASM would have to be updated to at least 9.5 to support Java 21.

@benken-parasoft
Copy link
Author

It would be nice if Jython pushed out regular service releases for third party library updates to stay ahead of re-occurring issues like this as well as CVEs like the one in Guava (issue 269).

@jeff5
Copy link
Member

jeff5 commented Feb 17, 2024

I notice the build.xml references ASM 9.3 which supports Java 19. I expect ASM would have to be updated to at least 9.5 to support Java 21.

I'll see if it's that simple.

jeff5 added a commit to jeff5/jython that referenced this issue Feb 17, 2024
@jeff5
Copy link
Member

jeff5 commented Feb 17, 2024

I'll see if it's that simple.

It is. Thanks for suggesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants