By cwebster on Feb 10, 2007
I was looking at Rhino , specifically to see how easy or hard accessing the debugging information would be. As it turns out, things are pretty easy. I have created a NetBeans project which has the basic infrastructure set up to run a script in the debugger. The project is accessible here
The essential part of getting this setup is the interaction with the context class, the following must be added:
RhinoDebugger debugger = new RhinoDebugger();
context.setDebugger(debugger, "sample debugger" ;
The debugger implementation in this code is not much more than print statement, but does show how to access properties in scope.
The sample project requires a reference to Rhino, which is not included so you will need to download this (I used 1.6_R2). This is the same version as in J2SE 6, but includes everything such as E4x. NetBeans projects are based on ant, so the built scripts can be executed outside of NetBeans, just add an entry to the project.properties of the form file.reference.js.jar=PATH_TO_RHINO.