Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Java's ScriptEngine object

I started using the ScriptEngine for running javascript code. I find its very useful and good for my needs, but one thing is missing, and its debugging. How can i do it? I really wish to be able to just put a breakpoint or step-into and see the js interpreter runs my code, step by step. is that possible?

like image 916
buddy123 Avatar asked Nov 24 '13 13:11

buddy123


1 Answers

Admittedly, this isn't a great answer (but your question lacks some detail on what JDK or tools you're looking to debug with).

In any case, if you're using IntelliJ as your IDE it comes with a Nashorn debugger that allows you to step through both JavaScript code and any references Java code too.

More details are here: http://blog.jetbrains.com/idea/2014/03/debugger-for-jdk8s-nashorn-javascript-in-intellij-idea-13-1/

like image 193
Ishan Chatterjee Avatar answered Nov 01 '22 02:11

Ishan Chatterjee