groovyfx-project / groovyfx

A library for writing JavaFX 8 applications in the Groovy language.
http://groovyfx.org
Apache License 2.0
199 stars 50 forks source link

Running samples with JDK9 results in exception #52

Closed aalmiray closed 8 years ago

aalmiray commented 8 years ago

As shown by @russel in #42

java.lang.RuntimeException: Could not init groovyx.javafx.SceneGraphBuilder because of an exception in groovyx.javafx.SceneGraphBuilder.registerControls
    at groovy.util.FactoryBuilderSupport.callAutoRegisterMethods(FactoryBuilderSupport.java:214)
    at groovy.util.FactoryBuilderSupport.autoRegisterNodes(FactoryBuilderSupport.java:188)
    at groovy.util.FactoryBuilderSupport.<init>(FactoryBuilderSupport.java:162)
    at groovyx.javafx.SceneGraphBuilder.<init>(SceneGraphBuilder.groovy:91)
    at groovyx.javafx.SceneGraphBuilder.<init>(SceneGraphBuilder.groovy)
    at groovyx.javafx.GroovyFX.start(GroovyFX.java:34)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(javafx.graphics@9-ea/LauncherImpl.java:843)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(javafx.graphics@9-ea/PlatformImpl.java:449)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$9(javafx.graphics@9-ea/PlatformImpl.java:418)
    at java.security.AccessController.doPrivileged(java.base@9-ea/Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(javafx.graphics@9-ea/PlatformImpl.java:417)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(javafx.graphics@9-ea/InvokeLaterDispatcher.java:96)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(javafx.graphics@9-ea/Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$8(javafx.graphics@9-ea/GtkApplication.java:195)
    at java.lang.Thread.run(java.base@9-ea/Thread.java:843)
Caused by: java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:535)
    at groovy.util.FactoryBuilderSupport.callAutoRegisterMethods(FactoryBuilderSupport.java:209)
    ... 14 more
Caused by: java.lang.ExceptionInInitializerError
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-ea/Native Method)
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-ea/NativeConstructorAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-ea/DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(java.base@9-ea/Constructor.java:455)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
    at groovyx.javafx.SceneGraphBuilder.registerControls(SceneGraphBuilder.groovy:569)
    ... 19 more
Caused by: java.lang.NumberFormatException: For input string: "9-e"
    at jdk.internal.math.FloatingDecimal.readJavaFormatString(java.base@9-ea/FloatingDecimal.java:2054)
    at jdk.internal.math.FloatingDecimal.parseFloat(java.base@9-ea/FloatingDecimal.java:122)
    at java.lang.Float.parseFloat(java.base@9-ea/Float.java:451)
    at java.lang.Float.valueOf(java.base@9-ea/Float.java:415)
    at org.codehaus.groovy.runtime.StringGroovyMethods.toFloat(StringGroovyMethods.java:3450)
    at org.codehaus.groovy.runtime.dgm$1185.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at groovyx.javafx.JdkUtil.jdkIsBefore8(JdkUtil.groovy:5)
    at groovyx.javafx.JdkUtil$jdkIsBefore8.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at groovyx.javafx.factory.TreeItemFactory.<clinit>(TreeItemFactory.groovy:41)
    ... 29 more
russel commented 8 years ago

Splendid, but I am seemingly unable to compile. :-( Using JDK8 or JDK9 leads to error. :-(

aalmiray commented 8 years ago

What errors do you get? I'm sad to say this but "it works on my machine" 😏

russel commented 8 years ago

@aalmiray It is down to the fact that OpenJDK8 has no JavaFX and it seems that JDK9 138 doesn't either.

aalmiray commented 8 years ago

Ah yes, OpenJDK8 may require an additional binary from OpenJFX. I tried JDK9-138 in OSX but with a much simpler example to figure out if JdkUtil was working correctly, but couldn't get a simple SGB example to work.

russel commented 8 years ago

Does OpenJFX release a JDK8 build as opposed to the source, I had a quick look but couldn't see anything – but I may have been too quick and missed it.