Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Java 10/11 #8

Open
smarkwell opened this issue May 4, 2018 · 8 comments
Open

Support for Java 10/11 #8

smarkwell opened this issue May 4, 2018 · 8 comments

Comments

@smarkwell
Copy link

A java.lang.ClassNotFoundException: com.sun.javafx.css.StyleConverterImpl is triggered on start with Java 10.0.1
This issue may not be limited to Windows

C:\Users\bwScott\Downloads> java --version
java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
C:\Users\bwScott\Downloads> java -jar .\Everest-Alpha-1.0.jar
Connected to database.
Settings file found. Loading settings...
Settings file not found. Using defaults
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/StyleConverterImpl
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
        at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at com.jfoenix.controls.JFXButton$StyleableProperties.<clinit>(JFXButton.java:167)
        at com.jfoenix.controls.JFXButton.<init>(JFXButton.java:147)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.base/java.lang.Class.newInstance(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
        at com.rohitawate.everest.main.Main.start(Main.java:39)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.StyleConverterImpl
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 32 more
Exception running application com.rohitawate.everest.main.Main
@RohitAwate RohitAwate added bug Something isn't working and removed bug Something isn't working labels May 4, 2018
@RohitAwate
Copy link
Owner

I think this has got something to do with the Java version. I'm using JFoenix for the buttons and even they seem to be having this issue. I'll have to produce different binaries for Java 9 and above, I think.

I'll look deeper into this and fix this soon.

@virmundi
Copy link
Contributor

virmundi commented May 6, 2018

Java 9+ kicked JavaFX out of the JVM. It's an attachment now.

Best I can see, you'll need to either have dual releases, or ship a zero-dependency version that's based on Java 9.

@RohitAwate
Copy link
Owner

Oh, I remember reading that it will be kicked out in JDK 11 but remain a part of JDK 10. Did they kick it out of Java 10's JVM, too?

I was planning on using Java 8's javapackager but jlink looks quite promising. Thanks for the info. I'll definitely consider using this.

@RohitAwate
Copy link
Owner

UPDATE: I received an email with someone asking if Java 10 will be supported. Looks like the comment was deleted. Java 10 support is definitely happening but is a low priority at the moment.

@RohitAwate
Copy link
Owner

The mock-server branch is now compatible with Java 11 and I believe that should cover 10, too, not tested though. Building and running is a bit tedious at the moment.

JavaFX has been decoupled from the JDK so I'm trying to get it via Maven, but that is not working for some reason. I'm able to run Everest with the JavaFX SDK, however.

Use these VM arguments:

--module-path
"Path-To-JavaFX-SDK"
--add-modules=javafx.controls,javafx.fxml,javafx.web
--add-opens
javafx.graphics/javafx.scene.text=ALL-UNNAMED
--add-exports
javafx.graphics/com.sun.javafx.text=ALL-UNNAMED
--add-opens
javafx.graphics/com.sun.javafx.text=ALL-UNNAMED
--add-exports
javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED
--add-exports
javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED
--add-exports
javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED
-Dprism.allowhidpi=false

-Dprism.allowhidpi=false might not be necessary on Linux because HiDPI support is only enabled by default on Windows AFAIK. Not sure about macOS.

The --add-opens and --add-exports arguments should hopefully disappear with future releases of RichTextFX as discussed in FXMisc/RichTextFX#776.

I'll be trying to provide native installers running on AdoptOpenJDK/OpenJFX 11 for the releases henceforth, so no JDK installation should be necessary.

@RohitAwate RohitAwate changed the title Fails to start on Windows 10, Java 10.0.1 Support for Java 10/11 Dec 24, 2018
@raaffaaeell
Copy link

raaffaaeell commented Jan 8, 2019

<dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-controls</artifactId> <version>11</version> </dependency> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-fxml</artifactId> <version>11</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.1</version> </dependency>

And changing the jfoenix dependency to version 9.0.0

No need to wrappers or something, just the mvn commands. I don't know if theres another cool way to do it, but with maven one could wrap these dependencies in a profile.

Edit: Also sorry for the bad formatting here, I dont know why it isnt working

@Jugen
Copy link

Jugen commented Apr 18, 2019

Be advised that RichtextFX v0.10.0 has now been released which does away with the --add-opens and --add-exports arguments.

@RohitAwate
Copy link
Owner

RohitAwate commented Apr 25, 2019

@Jugen thanks for your work! Now we're down to just a single --add-exports (required by JFoenix):
--add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED

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

No branches or pull requests

5 participants