jsr223

Get data back from Jython scripts using JSR-223

Hello. I am using Jython 2.5.1 with JSR-223 (i.e. javax.script package) and I expect the last line of the Python script to be returned. For example, after evaluating this script: class Multiplier: def multiply(self, x, y): return x * y Multiplier().multiply(5, 7) I should get back 35, but I get null instead. In other hand it w...

Cannot load JRubyEngine because org.apache.bsf.util.BSFEngineImpl not found

Hi, I'm trying to use JRuby in a custom application, and I don't seem to be able to load the JRubyEngine object. My class looks like functionally similar to this: public class ScriptEngine { private static ScriptEngine engine = new JRubyEngine(); public void run(final String script, final Map<String,Object> input) { fi...

Replace <Unknown Source> in Java Rhino (JSR223) with actual file name

Hello everyone, In my code, all of the scripts are contained in .js files. Whenever one of the scripts contains an error, I get this: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "nonexistant" is not defined. (<Unknown source>#5) in <Unknown source> at line number 5 What bugs me is the <...

Why doesn't jrunscript honor my classpath?

I'm trying to do some JDBC access from JavaScript using the Rhino included in Java 6. But I cannot make the DriverManager find the Driver I want to use. These two examples should be equivalent: Java: public class DbTest { public static void main(String[] argv) { java.sql.Connection c = null; try { java....

Simulate main thread and invoke SwingUtilities when using Scripting for Java

I am using Scripting for Java in JDK 6 on Win7 to build Swing GUIs and I am trying to determine the best means to emulate a typical Java execution environment when launching a script with the JDK\bin\jrunscript.exe program. I have the following file extension and association set up in my environment. assoc .jsx=JSXFile ftype JSXFile=c:...