Opened 9 years ago
Last modified 6 years ago
#11924 closed enhancement
Add compatibility with Java 9 — at Version 76
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 OracleFindbugs does not recognize new version string ==> bug and PR created==> fixed- JEP 272 removes
com.apple.eawt
package ==> 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
Ant does not work anymore==> Bug created + workaround done in r10259javabug:8152912 deprecates==> fixedXMLReaderFactory
- Groovy bug: https://issues.apache.org/jira/browse/GROOVY-7879
Unit tests:
- jacoco has problems with nashorn:
Method jdk.dynalink.linker.LinkerServices.$jacocoInit()[Z must be InterfaceMethodref constant
log ==> See #13150 for fix- Could not initialize class org.openstreetmap.josm.data.validation.tests.OpeningHourTest and Could not initialize class org.openstreetmap.josm.data.validation.OsmValidator (they are shomehow destroyed by a combination of jacoco + nashorn)
- EqualsVerifier fails in 2 unit tests
- Projections seem to be off by the last digit. log
Plugins:
- Geotools does not work ==> https://osgeo-org.atlassian.net/browse/GEOT-5289
- Apache Commons does not compile ==> https://issues.apache.org/jira/browse/COLLECTIONS-593
Change History (76)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
comment:3 by , 9 years ago
Description: | modified (diff) |
---|
comment:4 by , 9 years ago
Description: | modified (diff) |
---|
comment:5 by , 9 years ago
Description: | modified (diff) |
---|
comment:8 by , 9 years ago
Description: | modified (diff) |
---|
comment:10 by , 9 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 , 9 years ago
Found it, it's a change of behaviour from javabug:8068749:
Java SE has been changed so that
javax.imageio.spi.ServiceRegistry
no 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 useServiceRegistry
for non-Image-I/O services will causeIllegalArgumentException
to be thrown at runtime. Such applications should be migrated to usejava.util.ServiceLoader
instead ofjavax.imageio.spi.ServiceRegistry
.
comment:12 by , 9 years ago
Bug reported to GeoTools: https://osgeo-org.atlassian.net/browse/GEOT-5289
comment:15 by , 9 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 , 9 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 , 9 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 , 9 years ago
Description: | modified (diff) |
---|
comment:26 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Add compatibility with Java 9 / Jigsaw → Add compatibility with Java 9 |
comment:38 by , 9 years ago
Description: | modified (diff) |
---|
comment:40 by , 9 years ago
Description: | modified (diff) |
---|
comment:41 by , 9 years ago
Description: | modified (diff) |
---|
comment:42 by , 9 years ago
Description: | modified (diff) |
---|
comment:44 by , 9 years ago
Description: | modified (diff) |
---|
comment:47 by , 9 years ago
Description: | modified (diff) |
---|
comment:48 by , 9 years ago
Description: | modified (diff) |
---|
comment:54 by , 8 years ago
Description: | modified (diff) |
---|
comment:64 by , 8 years ago
Core works relatively fine with Java 9. I have started to look at plugins, as expected they don't even compile. First error lies in Apache Commons code: https://issues.apache.org/jira/browse/COLLECTIONS-593
comment:65 by , 8 years ago
Description: | modified (diff) |
---|
comment:66 by , 8 years ago
Description: | modified (diff) |
---|
comment:67 by , 8 years ago
Description: | modified (diff) |
---|
I found some more problems in the unit tests.
comment:68 by , 8 years ago
Description: | modified (diff) |
---|
comment:72 by , 8 years ago
Description: | modified (diff) |
---|
comment:75 by , 8 years ago
Description: | modified (diff) |
---|
comment:76 by , 8 years ago
Description: | modified (diff) |
---|
In 8816/josm: