1

I work on a java standalone project that use rhino to run javascript. Those scripts are mainly objects manipulation.

Using logger in the javascript is not always enough so i would like to use something like the java debugger in eclipse.

I can't find a way to debug the javascript files in Eclipse: even if I put breakpoint in my files, the scripts execution is never suspended.

I run Eclipse Kepler and have the Javascript Development Tools plugin.

Is there any simple way to do that?

5
  • You won't debug your Javascript with a Java Debugger, that's for sure. Commented Aug 12, 2014 at 13:20
  • Not sure if this helps/you're already aware, but modern browsers (read: not ie) contain ways to view and debug code in the browser. For example in firefox, right click -> Inspect element -> Debugger. There you can set break points and step through many files. I've not used rhino, so I cant say if it applies to your situation for sure. Commented Aug 12, 2014 at 13:24
  • @meskobalazs : that's why I ask for help. Commented Aug 12, 2014 at 13:25
  • @schil227: my scripts are not run in a browser. they are interpreted by rhino directly in my app. Commented Aug 12, 2014 at 13:26
  • AFAIK the best way currently is using the debugger of a browser, I am quite satisfied with Firebug. Unfortunately JS is sorely lacking when it comes to debugging. Commented Aug 12, 2014 at 13:27

1 Answer 1

3

Rhino has a visual debugger built in (org.mozilla.javascript.tools.debugger.Main) which you can use to debug embedded scripts.

You can also use Eclipse to debug embedded Rhino using the org.eclipse.wst.jsdt.debug.rhino.debugger and org.eclipse.wst.jsdt.debug.transport plugins in Juno (presumably this works in later versions too.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.