Opened 10 years ago
Last modified 7 years ago
#11924 closed enhancement
Add compatibility with Java 9 — at Version 47
| Reported by: | Don-vip | Owned by: | team |
|---|---|---|---|
| Priority: | major | Milestone: | 17.08 |
| Component: | Core | Version: | |
| Keywords: | java9 jigsaw javabug | Cc: |
Description (last modified by )
Java 9 is well advanced in its development, early builds are now available. Jigsaw project is now merged into main tree.
I have added basic Java 9 support in r8777:8778, r8793, r8795, r8796:8797 but making JOSM work with Jigsaw is another challenge.
This ticket aims to list all problems encountered.
xmltask does not work ==> cannot build OSX package==> fork created- Proguard does not work ==> cannot build optimized jar
Groovy does not work ==> cannot run some tests + cannot build taginfo files==> fixed==> fixedResourceBundle.getBundle("sun.awt.resources.awt")results in an internal error ==> bug reported to Oracle- Findbugs does not recognize new version string ==> bug and PR created
- JEP 272 removes
com.apple.eawtpackage ==> need to updatePlatformHookOsx==> partially fixed, nedd more tests about deprecated methods, full screen, dock image javabug:6850612 deprecates==> fixedClass.newInstance==> replace it byClass.getConstructor().newInstance()javabug:8154801 deprecates==> fixedjava.util.Observer / java.util.Observable==> replace it byjavax.swing.ChangeListener
Change History (47)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:5 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:8 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:10 by , 10 years ago
All plugins load fine with Java 9 except ImportImagePlugin, which relies on geotools:
23:45:31.948 [main] FATAL org.openstreetmap.josm.plugins.ImportImagePlugin.ImportImagePlugin - Error while loading plugin java.lang.IllegalArgumentException: org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class at javax.imageio.spi.ServiceRegistry.checkClassAllowed(ServiceRegistry.java:733) ~[?:?] at javax.imageio.spi.ServiceRegistry.<init>(ServiceRegistry.java:138) ~[?:?] at org.geotools.factory.FactoryRegistry.<init>(FactoryRegistry.java:155) ~[geotools.jar:?] at org.geotools.factory.FactoryRegistry.<init>(FactoryRegistry.java:146) ~[geotools.jar:?] at org.geotools.factory.FactoryCreator.<init>(FactoryCreator.java:82) ~[geotools.jar:?] at org.geotools.referencing.ReferencingFactoryFinder.getServiceRegistry(ReferencingFactoryFinder.java:115) ~[geotools.jar:?] at org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:180) ~[geotools.jar:?] at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:455) ~[geotools.jar:?] at org.geotools.referencing.DefaultAuthorityFactory.getSupportedCodes(DefaultAuthorityFactory.java:125) ~[geotools.jar:?] at org.geotools.referencing.CRS.getSupportedCodes(CRS.java:396) ~[geotools.jar:?] at org.openstreetmap.josm.plugins.ImportImagePlugin.PluginOperations.loadCRSData(PluginOperations.java:366) ~[ImportImagePlugin.jar:?] at org.openstreetmap.josm.plugins.ImportImagePlugin.ImportImagePlugin.<init>(ImportImagePlugin.java:88) [ImportImagePlugin.jar:?]
I have no idea what's the problem yet. Maybe linked to JEP 262.
comment:11 by , 10 years ago
Found it, it's a change of behaviour from javabug:8068749:
Java SE has been changed so that
javax.imageio.spi.ServiceRegistryno longer allows service providers of other than Image I/O service types to be loaded. This is a behavioral change. Existing application binaries that attempt to useServiceRegistryfor non-Image-I/O services will causeIllegalArgumentExceptionto be thrown at runtime. Such applications should be migrated to usejava.util.ServiceLoaderinstead ofjavax.imageio.spi.ServiceRegistry.
comment:12 by , 10 years ago
Bug reported to GeoTools: https://osgeo-org.atlassian.net/browse/GEOT-5289
comment:15 by , 10 years ago
- Groovy does not work ==> cannot run some tests + cannot build taginfo files
As far as I could see, this problem is fixed in Groovy v2.4.6.
comment:16 by , 10 years ago
ResourceBundle.getBundle("sun.awt.resources.awt")results in an internal error ==> bug reported to Oracle
Also this problem seems to be fixed since 2015-11-10 (see https://bugs.openjdk.java.net/browse/JDK-8136804)
comment:17 by , 10 years ago
Yes, The Oracle bug is fixed in latest JDK9/Jigsaw builds. However Groovy 2.4.6 is not released yet.
comment:19 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:26 by , 10 years ago
| Description: | modified (diff) |
|---|---|
| Summary: | Add compatibility with Java 9 / Jigsaw → Add compatibility with Java 9 |
comment:38 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:40 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:41 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:42 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:44 by , 10 years ago
| Description: | modified (diff) |
|---|
comment:47 by , 10 years ago
| Description: | modified (diff) |
|---|



In 8816/josm: