This ticket tracks compatibility issues running OmegaT under Java 9.
Under JDK 9 Early Access Build 156 the following issues have been noted:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBContext at org.omegat.filters2.master.FilterMaster.<clinit>(FilterMaster.java:113) at org.omegat.Main.main(Main.java:171) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:532) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473) ... 2 more
This is because JAXB classes are not visible from the unnamed module by default
Add the arguments --add-modules java.xml.bind
to the java
invocation. This suffices to launch OmegaT; it is unknown if all features work correctly (OS X integration definitely does not work; see below).
Note that these arguments cause Java 8 to fail, so they are not appropriate for addition to existing launch scripts, etc., as long as we are supporting Java 8.
Bundle dependency JARs to replace the built-in java.xml.bind
module. By experiment it seems that these three packages suffice to allow OmegaT to launch:
compile 'javax.xml.bind:jaxb-api:2.3.0' compile 'org.glassfish.jaxb:jaxb-runtime:2.3.0' compile 'javax.activation:activation:1.1.1'
The solution appears to be to modularize OmegaT and declare an explicit dependency on java.xml.bind
in the module-info.java
file.
There are many hurdles to clear before this can be done:
See:
80246: Error: java.lang.IllegalAccessException: class org.omegat.util.gui.OSXIntegration cannot access class com.apple.eawt.Application (in module java.desktop) because module java.desktop does not export com.apple.eawt to unnamed module @6fd02e5
These APIs have been replaced entirely. We will have to add support for the new APIs as well, which we cannot do without targeting Java 9.
It may be possible to create, as a separate project, a bridge that wraps the old and new APIs.
See:
Diff:
Diff:
Java 10 has now been released. The same issues blocking Java 9 compatibility apply to 10 as well; it is not clear if 10 introduces additional issues.
So, considering the above, what's the plan for Java support after September when Java 8 gets EOL and Oracle releases Java 11 and fully switches to the new release cycle of a new Java version every 6 months (with LTS version evey 3 years, but only as a paid option)?
I am hoping to make OmegaT usable on Java 11 very soon. I'm closing this ticket as out-of-date in favor of [#1436].
Related
Feature Requests:
#1436