Opened 7 years ago

Last modified 6 years ago

#16047 closed enhancement

Add compatibility with Java 11 — at Version 41

Reported by: Don-vip Owned by: team
Priority: normal Milestone: 18.09
Component: Core Version:
Keywords: java11 Cc:

Description (last modified by Don-vip)

Follow-up of #15560

First EA builds of Java 11 are available.

Issues:

  1. WebStart will be removed in Java 11!
  2. Wiremock 2.13.0 uses javax.xml.bind.DatatypeConverter class which has been removed in JEP 320 => Solved by updating to 2.15
  3. Jacoco does not support Java 11 yet
  4. JDK-8198899: Signature of WindowsPreferences methods changes (hkey changed from int to long)
  5. Nashorn JavaScript Engine is deprecated!
  6. JMockit is not compatible with Java 11 yet

See #16498 for Java 12 compatibility.

Change History (41)

comment:1 by Don-vip, 7 years ago

Right now the build fails with:

compile-jmapviewer:
    [javac] Compiling 50 source files to /var/lib/jenkins/jobs/Java-EarlyAccess-JOSM/workspace/jdk/JDK11/build
    [javac] /var/lib/jenkins/jobs/Java-EarlyAccess-JOSM/workspace/jdk/JDK11/src/org/jdesktop/swinghelper/debug/CheckThreadViolationRepaintManager.java:19: error: cannot access WeakReference
    [javac] import java.lang.ref.WeakReference;
    [javac]                     ^
    [javac]   bad class file: /modules/java.base/java/lang/ref/WeakReference.class
    [javac]     class file has wrong version 55.0, should be 53.0
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac] 1 error

comment:2 by Don-vip, 7 years ago

In 13492/josm:

see #15560, see #16047 - disable error_prone on Java 10+, see https://github.com/google/error-prone/issues/860

comment:3 by Don-vip, 7 years ago

Now the tests fail due to removal of EE APIs: [junit] java.lang.module.FindException: Module java.se.ee not found

comment:4 by Don-vip, 7 years ago

In 13505/josm:

see #16047 - do not add EE modules with Java 11+

comment:5 by Don-vip, 7 years ago

Now jacoco crashes:

[jacoco:coverage] Enhancing junit with coverage
    [junit] FATAL ERROR in native method: processing of -javaagent failed
    [junit] java.lang.reflect.InvocationTargetException
    [junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [junit]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [junit]     at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    [junit]     at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:510)
    [junit]     at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:522)
    [junit] Caused by: java.lang.RuntimeException: Class java/lang/UnknownError could not be instrumented.
    [junit]     at org.jacoco.agent.rt.internal_36ebf62.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:139)
    [junit]     at org.jacoco.agent.rt.internal_36ebf62.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:100)
    [junit]     at org.jacoco.agent.rt.internal_36ebf62.PreMain.createRuntime(PreMain.java:55)
    [junit]     at org.jacoco.agent.rt.internal_36ebf62.PreMain.premain(PreMain.java:47)
    [junit]     ... 6 more
    [junit] Caused by: java.lang.NoSuchFieldException: $jacocoAccess
    [junit]     at java.base/java.lang.Class.getField(Class.java:1958)
    [junit]     at org.jacoco.agent.rt.internal_36ebf62.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:137)
    [junit]     ... 9 more

comment:6 by Don-vip, 7 years ago

(this was expected as Jacoco does not yet support Java 10, because of slow ASM releases...)

comment:7 by Don-vip, 7 years ago

Milestone: 18.09

comment:8 by Don-vip, 7 years ago

Description: modified (diff)

comment:9 by Don-vip, 7 years ago

In 13523/josm:

see #16047 - disable jacoco on Java 11+, see https://github.com/jacoco/jacoco/issues/629

comment:10 by Don-vip, 7 years ago

Description: modified (diff)

comment:11 by Don-vip, 7 years ago

Description: modified (diff)

comment:12 by Don-vip, 7 years ago

In 13524/josm:

see #16047 - update to awaitility-3.1.0

comment:13 by Don-vip, 7 years ago

In 13525/josm:

see #16047 - update to wiremock-2.15.0

comment:14 by Don-vip, 7 years ago

Description: modified (diff)

comment:15 by Don-vip, 7 years ago

Description: modified (diff)

comment:16 by Don-vip, 7 years ago

Java 11 build is stable! :)

comment:17 by Don-vip, 7 years ago

Description: modified (diff)

comment:19 by Don-vip, 7 years ago

Description: modified (diff)

comment:20 by Don-vip, 7 years ago

In 13651/josm:

see #16047 - make WinRegistry class work both with Java 8 and 11

comment:21 by Don-vip, 7 years ago

In 13695/josm:

see #15560, see #16047 - detect java 10/11 packages

comment:22 by Don-vip, 7 years ago

In 13700/josm:

see #15560, see #16047 - detect java 10/11 packages

comment:23 by Don-vip, 7 years ago

In 13715/josm:

see #16047 - implement workaround against problem seen with IcedTeaWeb 1.7.1 / Java 9 on Debian

comment:24 by Don-vip, 7 years ago

In 13716/josm:

see #16047 - catch correct exception

comment:25 by Don-vip, 7 years ago

In 13819/josm:

see #2089, see #16047 - move JavaFX classes to their own package in order to exclude them automatically when JavaFX is not on the classpath (needed for Java 11+ now that FX is gone)

comment:26 by Don-vip, 7 years ago

In 13820/josm:

see #16047 - tune add-exports options for Java 11

comment:27 by Don-vip, 7 years ago

In 13821/josm:

fix #16308, see #16047 - remove blank png icon. With jdk-11-ea+14 JOSM fails to load it (ImageProvider returns null). JDK bugs:

comment:28 by stoecker, 7 years ago

Hmm, the function should be in ImageProvider.

comment:29 by Don-vip, 7 years ago

In 13823/josm:

see #9984, see #16047 - Java 11 handles transparent PNG out of the box, disable JOSM mechanisms to force transparency on this version

comment:30 by Don-vip, 7 years ago

In 13944/josm:

see #16047 - Java 11 ea has trouble to access Google in https; don't care reporting issues now

comment:31 by Don-vip, 7 years ago

Description: modified (diff)

comment:32 by Don-vip, 7 years ago

In 13984/josm:

see #16047 - move method to ImageProvider

comment:33 by Don-vip, 7 years ago

A Java WebStart alternative: https://github.com/threerings/getdown

comment:34 by Don-vip, 7 years ago

In 13990/josm:

see #16047 - don't ask Java 8 users to upgrade to Java 10

comment:35 by Don-vip, 7 years ago

In 14002/josm:

see #16047 - update to equalsverifier 2.4.8 for Java 11 compatibility, see https://github.com/jqno/equalsverifier/issues/197

comment:36 by Don-vip, 7 years ago

Updates on plugin side:

[o34409] fix JAXB builds
[o34408] fix XJC scripts
[o34388] add JAF 1.2.0 from https://github.com/javaee/activation/releases/tag/JAF-1_2_0
[o34377] add svn:executable bit
[o34376] fix JAXB build
[o34375] include JAXB, removed in JDK11
[o34373] restore target=1.8, remove add-modules option for javac targets
[o34368] remove target=1.8, keep only source=1.8
[o34367] add java.activation,java.se.ee modules for Java 9/10
[o34366] add java.activation,java.se.ee modules for Java 9/10
[o34364] fix java version
[o34363] Add compatibility with Java 10/11

Last edited 7 years ago by Don-vip (previous) (diff)

comment:37 by Don-vip, 7 years ago

In 14033/josm:

see #16047 - update to Groovy 2.5.1 (includes update to ASM 6.2 for Java 11 compatibility)

comment:39 by Don-vip, 7 years ago

News:

comment:40 by Don-vip, 7 years ago

Description: modified (diff)

comment:41 by Don-vip, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.