Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Java 9/JDK9 compatibility #2594

Open
Siedlerchr opened this Issue Feb 28, 2017 · 13 comments

Comments

Projects
None yet
5 participants
Contributor

Siedlerchr commented Mar 1, 2017 edited

Apple/OSX compatibility:

These new methods replace the functionality of the internal APIs contained in the OS X package com.apple.eawt which are not accessible by default in JDK 9. Note that the package com.apple.eio is no longer accessible and no public replacement exists in JDK 9.

http://openjdk.java.net/jeps/272
http://download.java.net/java/jdk9/docs/api/java/awt/Desktop.html#setOpenFileHandler-java.awt.desktop.OpenFilesHandler-

Please note that for Mac OS, notifications are only sent if the Java app is a bundled application, with a CFBundleDocumentTypes array present in its Info.plist. See the Info.plist Key Reference for more information about adding a CFBundleDocumentTypes key to your app's Info.plist.

kaimast commented Apr 17, 2017 edited by Siedlerchr

I get the following error when trying to run JabRef on Linux with OpenJDK9. Should I file a new ticket for this?

kai@chipad:~/Downloads$ java -jar ./JabRef-3.8.2.jar
Apr 17, 2017 10:42:01 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
10:42:02.130 [AWT-EventQueue-0] INFO  net.sf.jabref.migrations.PreferencesMigrations - Migrating old custom entry types.
10:42:02.389 [AWT-EventQueue-0] ERROR net.sf.jabref.FallbackExceptionHandler - Uncaught exception Occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
	at net.sf.jabref.logic.importer.ImportFormatReader.resetImportFormats(ImportFormatReader.java:56) ~[JabRef-3.8.2.jar:?]
	at net.sf.jabref.JabRefMain.start(JabRefMain.java:78) ~[JabRef-3.8.2.jar:?]
	at net.sf.jabref.JabRefMain.lambda$main$0(JabRefMain.java:40) ~[JabRef-3.8.2.jar:?]
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) ~[?:?]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:759) ~[?:?]
	at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:?]
	at java.awt.EventQueue$3.run(EventQueue.java:712) ~[?:?]
	at java.awt.EventQueue$3.run(EventQueue.java:706) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:88) ~[?:?]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:729) ~[?:?]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199) [?:?]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
	at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:533) ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:476) ~[?:?]
	... 17 more
Contributor

Siedlerchr commented Apr 17, 2017

Thanks for your report. this is a problem we still have to solve.
A while ago I posted a workaround: You need to clone the repo and compile the code (with jdk8) for yourself using ./gradlew build (ignore the failing tests). That will generate some startup scripts that work with jdk9

Contributor

Siedlerchr commented Aug 17, 2017

As jdk9 is on it's way to the final release, we definitely should focus on getting JabRef to work with jdk9.

@koppor koppor referenced this issue in michaellass/AUR Aug 18, 2017

Merged

Pin Java to 8 #8

Contributor

Siedlerchr commented Sep 23, 2017

Okay, the final release of java 9 is out and I played around with jdeps to anaylze dependencies to internal jdk libs:
To summarize:
controlsfx
Our custom hack
and wiremock

build -> JDK removed internal API
build -> javafx.controls
build -> javafx.graphics
   org.jabref.gui.customjfx.CustomJFXPanel            -> com.sun.javafx.embed.EmbeddedSceneInterface        JDK internal API (javafx.graphics)
   org.jabref.gui.fieldeditors.EditorTextArea         -> com.sun.javafx.scene.control.behavior.BehaviorBase JDK internal API (javafx.controls)
   org.jabref.gui.fieldeditors.EditorTextArea         -> com.sun.javafx.scene.control.behavior.TextAreaBehavior JDK internal API (javafx.controls)
   org.jabref.gui.fieldeditors.EditorTextArea         -> com.sun.javafx.scene.control.skin.TextAreaSkin     JDK internal API (JDK removed internal API)
   org.jabref.gui.fieldeditors.EditorTextArea$1       -> com.sun.javafx.scene.control.skin.TextAreaSkin     JDK internal API (JDK removed internal API)
   org.jabref.logic.l10n.LocalizationParser           -> com.sun.javafx.application.PlatformImpl            JDK internal API (javafx.graphics)
customjfx-1.0.0.jar -> javafx.base
customjfx-1.0.0.jar -> javafx.graphics
   org.jabref.gui.customjfx.support.InputMethodSupport -> com.sun.javafx.collections.ObservableListWrapper   JDK internal API (javafx.base)
   org.jabref.gui.customjfx.support.InputMethodSupport$InputMethodRequestsAdapter -> com.sun.javafx.scene.input.ExtendedInputMethodRequests JDK internal API (javafx.graphics)
objenesis-2.6.jar -> jdk.unsupported
   org.objenesis.instantiator.sun.UnsafeFactoryInstantiator -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   org.objenesis.instantiator.util.ClassDefinitionUtils -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   org.objenesis.instantiator.util.UnsafeUtils        -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
wiremock-2.8.0.jar -> java.xml
   com.github.tomakehurst.wiremock.matching.EqualToXmlPattern$SkipResolvingEntitiesDocumentBuilderFactory -> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl JDK internal API (java.xml)


Warning: JDK internal APIs are unsupported and private to JDK implementation that are
subject to be removed or changed incompatibly and could break your application.
Please modify your code to eliminate dependence on any JDK internal APIs.
For the most recent update on JDK internal API replacements, please check:
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool

JDK Internal API                         Suggested Replacement
----------------                         ---------------------
sun.misc.Unsafe                          See http://openjdk.java.net/jeps/260

Contributor

Siedlerchr commented Sep 26, 2017

Controlsfx has a java9 comptaible 9.0.0 release http://fxexperience.com/controlsfx/
FontawesomeFX is working on java 9 support: https://bitbucket.org/Jerady/fontawesomefx/issues/48/cssparser-unavailable-in-java-9

Contributor

Siedlerchr commented Sep 27, 2017

FontawesomeFX 9.0.0 is out, with java 9 module support
http://www.jensd.de/wordpress/?p=2686

@Siedlerchr Siedlerchr referenced this issue in tomakehurst/wiremock Sep 27, 2017

Open

JAVA 9 compatiblity #764

Contributor

tobiasdiez commented Sep 27, 2017

wiremock shouldn't be a problem as it is only used in the tests

Owner

lenhard commented Oct 3, 2017

So just to sum up and make sure that I understand everything: Our major problems with Java 9 are:

  • Some apple extensions are gone and we are going to need special packaging for IOS?
  • We need a release of OpenJDK with a fix to the special characters bug (did they honestly push the fix that they already implemented to v10 as in Java 10? Please tell me this is not true) or we need to change our local fix for it (this smells very much like a blocker).
Contributor

Siedlerchr commented Oct 3, 2017

The main blocker is that we have to adjust our start build scripts/installer to add these command line parameter for module config stuff.
https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7744EF96-5899-4FB2-B34E-86D49B2E89B6

Apple Extensions have somehow been directly incorporated (If I read the changelog correct)

lharzenetter commented Oct 12, 2017 edited

I also have a similar problem using JDK9:

  • version 9+181, 64bit
  • Windows 10 Pro

I just installed JabRef using choco. After I started it, I got the following error:

10:32:20.625 [AWT-EventQueue-0] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[AWT-EventQueue-0,6,main]
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
        at org.jabref.logic.importer.ImportFormatReader.resetImportFormats(ImportFormatReader.java:55) ~[JabRef-4.0.jar:?]
        at org.jabref.JabRefMain.start(JabRefMain.java:94) ~[JabRef-4.0.jar:?]
        at org.jabref.JabRefMain.lambda$start$0(JabRefMain.java:53) ~[JabRef-4.0.jar:?]
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) ~[?:?]
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) ~[?:?]
        at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:?]
        at java.awt.EventQueue$3.run(EventQueue.java:717) ~[?:?]
        at java.awt.EventQueue$3.run(EventQueue.java:711) ~[?:?]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89) ~[?:?]
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) ~[?:?]
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199) ~[?:?]
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?]
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?]
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?]
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
        at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[?:?]
        at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:496) ~[?:?]
        ... 17 more
Contributor

Siedlerchr commented Oct 12, 2017

Hi, yes this is a known problem. You have to use java 8 for JabRef, JabRef currently does not support java9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment