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
Grape examples appear to be incomplete #42
Comments
I think we need to separate the JDK8 and JDK9 problems into two. Also we need to be sure which Groovy versions are being used. This script with JDK9 119 gives me the java.lang.ExceptionInInitializerError but the stack is totally different. Can I propose we close this issue and start two new ones? |
Same thing for me, with a Groovy script using a same Grab annotation.
Bertrand |
If I change Note: I test it with the example code of the GroovyFX project home page. If the app starts well, I have a white background (instead of black), and the window width seems not correct. |
@bgoetzmann If I change to 0.4.0 I just get a:
Sorry the above was an error on my part – phasing error between editor and shell. The actual error I get with JDK8 is:
or with JDK9
|
With 8.0.0 on JDK9 I get:
and with JDK8 I get:
|
Ah lovely. Looks like the specific version of Groovy can't parse the new JDK9 version number. That's the problem @russel encounters when running with JDK9. Now on JDK8 we get a toolkit initialization exception (I can confirm the exception). This may be caused by an early access to a JavaFX class in SGB before the toolkit has been properly initialized. I can have a loom at this issue tonight at the Luzern Hackergarten, |
@aalmiray Do you think the parsing is a Groovy or GroovyFX thing? |
I was too quick to judge on Groovy directly, the problem is in GroovyFX given the stacktrace
This means we can fix the problem from our side ;-) |
We should publicise the way people can use this artefact prior to it being published formally. |
Hi @kastork I had the same problem (jdk8, grape and Toolkit not initialized) and I was able to solve it using grape API instead of annotation. I think grape load services from MANIFEST before JafaFX to be ready https://gist.github.com/jagedn/3ebc5a11f16743c7362b836827ffe3ce |
Related to the comment from @russel --can someone describe how we can make use of this fix today since it does not appear 8.1 has been published yet? |
@mfreeman-xtivia based on the example of @jagedn, I believe this has something to do with Grape and they it loads dependencies, the best way for now is to use Gradle, this is what works for me:
Using: |
I "solved" the issue using a launcher who initialized javafx before to run the real script LaunchFXScript.groovy
MyFXScript.groovy
so you can run but I know it's a trick |
When trying to run an example using the suggested @grab approach. Receive an exception.
e.g. this is the accordion example copied from the demos directory. Then, as suggested in README, add the Grab annotation.
Then, using either
groovy AccordionDemo.groovy
or
groovy -cp $JAVA_HOME/jre/lib/ext/jfxrt.jar AccordionDemo.groovy
results in
The google machine suggests this error can be corrected by instantiating a
JFXPanel
by hand, but I'm not sure where you would do this. I tried it at the root script level:and also at the top of the start block with no success.
Also, I've seen people suggest this
@GrabConfig(systemClassLoader=true, initContextClassLoader=true)
Also no change
So it seem like there must be a missing step in those places where you suggest a
@Grape
invocation to pull in groovyfx.I'd try it with the 9.0 snapshot, but it doesn't seem to resolve.
The text was updated successfully, but these errors were encountered: