Maybe I can help out.
I've been toying for months now with Nashorn (jjs) but when I use Nashorn, I only use jjs and do not embed the JS engine inside another java-based interpreter.
1st: make sure your JDK8 is complete. It should not be the server JRE but the full JDK8.
2nd: to confirm javafx is included in your environment, try the following lines in jjs.
If javafx is not in your JDK8, you'll see this:
jjs> Java.type('javafx.beans.value.ChangeListener')
java.lang.RuntimeException: java.lang.ClassNotFoundException: javafx.beans.value.ChangeListener
In that case, it'll never work in jruby and you need to reinstall JDK8 properly.
This is how it should look like in jjs if javafx is included in your environment:
jjs> Java.type('javafx.beans.value.ChangeListener')
[JavaClass javafx.beans.value.ChangeListener]
Once this is ok, you just need to add the following line inside your ruby script (preferably after require 'java') :