Issue2630

classification
Title: Cannot import java.awt.* on Java 9
Type: behaviour Severity: major
Components: Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, jamesmudd, jeff.allen, sergei175, zyasoft
Priority: high Keywords: Java Roadmap

Created on 2017-10-13.02:21:45 by sergei175, last changed 2019-03-08.07:41:07 by jeff.allen.

Messages
msg11620 (view) Author: Sergei (sergei175) Date: 2017-10-13.02:21:43
I'm using Jython 2.7.1 and I notice that it cannot import by default the standard Java libraries when using JDK9 (on ubuntu).  Example:

>from java.awt import *
>c=Color.red

This failed.  I have to import all classes explicitly, i.e. "from java.awt import Color". I guess, Java9 has different locations of the standard jar libraries. How to enable this feature again?
msg11621 (view) Author: James Mudd (jamesmudd) Date: 2017-10-13.11:55:22
Duplicate of #2362
msg11622 (view) Author: Sergei (sergei175) Date: 2017-10-13.23:29:13
Thanks, I consider this is a very serious problem that breaks just everything around Jython, i.e. documentation, blogs, books, etc. It has not been solved for 2 years, according to #2362.  Maybe there is simple workaround?
msg11623 (view) Author: James Mudd (jamesmudd) Date: 2017-10-17.18:01:44
The simple workaround I guess is to use Java 8 not 9. Java 9 has only been out a few weeks and no Jython versions at the moment claim to fully support it.

Having said that I agree this is a serious issue, which need to be fixed as soon as possible.
msg11847 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-23.08:34:38
(For discussion) I'm allocating this to 2.7.2 on the principle that we ought not to hold users back at Java 8.
msg12161 (view) Author: Jeff Allen (jeff.allen) Date: 2018-10-26.18:19:40
Skipped on Java 9+ for now in: https://hg.python.org/jython/rev/5aa64ce0b8b8
msg12316 (view) Author: Jeff Allen (jeff.allen) Date: 2019-01-12.14:04:27
Fixed now wioth #2362.
History
Date User Action Args
2019-03-08 07:41:07jeff.allensetstatus: pending -> closed
2019-01-12 14:04:27jeff.allensetstatus: open -> pending
resolution: accepted -> fixed
messages: + msg12316
2018-10-26 18:19:40jeff.allensetmessages: + msg12161
2018-03-23 08:34:38jeff.allensettitle: jython 2.7.1 cannot import java.awt.* -> Cannot import java.awt.* on Java 9
nosy: + jeff.allen, fwierzbicki, zyasoft
messages: + msg11847
priority: high
milestone: Jython 2.7.1 -> Jython 2.7.2
keywords: + Java Roadmap
resolution: accepted
2017-10-17 18:01:44jamesmuddsetmessages: + msg11623
2017-10-13 23:29:13sergei175setmessages: + msg11622
2017-10-13 11:55:22jamesmuddsetnosy: + jamesmudd
messages: + msg11621
2017-10-13 02:21:45sergei175create