Debug Javascript within Eclipse using Rhino

纵饮孤独 提交于 2019-12-03 13:58:56

问题


I have installed JavaScript Development Tools Plugin for Eclipse, but i am not able to run or debug a JavaScript Project.

I want to debug using the inbuilt Rhino Interpreter, not using a web browser.

I have created a JavaScript project and when I try to create a run configuration, it says "Please select a valid project" and the run button is greyed out..

Please view the attached snapshot.


回答1:


Which version of eclipse are you using? Install Eclipse 3.7 Java EE Version, there you could directly right click on the javascript file (.js extension) and Debug As -> Rhino JavaScript. Please see the attached image.

The Debug configuration will look as below. There will not be any browse for project, you need to browse directly javascript file as shown in below image (you can browse all the javascript files from the entire workspace).




回答2:


Apparently you didn't create a valid javascript project. Depending on your Eclipse version, this is for Juno, go to File - New - Javascript Project.

Javascript projects don't have a "nature" associated with them that let you know in the Project Explorer. Spring, Java, or even Perl projects have this in eclipse. It's a symbol assigned to a project that lets Eclipse know what type of project it is. Java projects have a "J", Spring projects have an "S".



来源:https://stackoverflow.com/questions/10312766/debug-javascript-within-eclipse-using-rhino

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!