Search code examples
javascriptjavarhino

How to run (or build then run?) this Mozilla Rhino Debugger?


Would like to try this Rhino Debugger however having problems

I downloaded latest from here according to doc it says just simply run:

java org.mozilla.javascript.tools.debugger.Main [options] [filename.js] [script-arguments]

however..it's source code, so I probably need to build it first...(unless there are precompiled download out there?). Assuming I need to build it to get the jar file for debugger, I assume just build the build.gradle file at the root dir. Or run gradle tasks build ? When I do that I get error:

Execution failed for task ':checkstyleMain'.Unable to create a Checker: configLocation {C:\rhino\rhino-1.7.8\checkstyle.xml}, classpath {C:\rhino\rhino-1.7.8\buil dGradle\classes\java\main;C:\rhino\rhino-1.7.8\buildGradle\resources\main}.

So..I'm a bit lost. Been ten years since I've worked with Java, but hopefully I'm missing something simple.

Any experienced Rhino JavaScript devs out there that can point me in the right direction? Should I just stick with using Eclipse? (Had that working, but I'm still curious about this debugger)


Solution

  • Download the latest rhino from the link you provided, at this time it is "rhino-1.7.8.zip". Unzip that and change directory to "rhino1.7.8/lib"; you need the "rhino-1.7.8.jar" in your CLASSPATH. Assuming you are in "rhino1.7.8/lib" that should be in your current folder, and you can then do

    java -cp rhino-1.7.8.jar org.mozilla.javascript.tools.debugger.Main
    

    Which should render like

    Rhino Debugger