在 NetBeans/Eclipse 中运行 JavaScript 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3843245/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:09:48  来源:igfitidea点击:

Run JavaScript file in NetBeans/Eclipse?

javascripteclipsenetbeansnode.js

提问by never_had_a_name

Is there a way to run a JavaScript file directly in NetBeans or Eclipse?

有没有办法直接在 NetBeans 或 Eclipse 中运行 JavaScript 文件?

I feel it's time consuming to fire up a terminal, browse to that file and run it with node all the time.

我觉得启动终端、浏览到该文件并一直使用 node 运行它很耗时。

回答by Tim Boudreau

Another NetBeans Node.jsplugin with a Node.js project type and npm integration (I am the author of it) is described in NetBeans Tools for Node.js

NetBeans Tools for Node.js 中描述了另一个具有 Node.js 项目类型和 npm 集成(我是它的作者)的NetBeans Node.js插件

回答by mh.

Yes, you can debug using Rhino in "Run As" without leaving Eclipse: http://wiki.eclipse.org/JSDT/Debughttp://www.eclipse.org/webtools/jsdt/debug/

是的,您可以在“运行方式”中使用 Rhino 进行调试,而无需离开 Eclipse:http: //wiki.eclipse.org/JSDT/Debughttp://www.eclipse.org/webtools/jsdt/debug/

If you'd like to debug it remotely on a Node.js instance, you can use: https://github.com/ry/node/wiki/Using-Eclipse-as-Node-Applications-Debugger

如果你想在 Node.js 实例上远程调试它,你可以使用:https: //github.com/ry/node/wiki/Using-Eclipse-as-Node-Applications-Debugger

If you'd like to remote debug a Chrome/Chromium browser: http://code.google.com/p/chromedevtools/wiki/EclipseDebugger

如果您想远程调试 Chrome/Chromium 浏览器:http: //code.google.com/p/chromedevtools/wiki/EclipseDebugger

The latter two options will use V8, which is Google's JS engine behind Chrome, which has also been implemented in Node.js. The first option will use Rhino, which is Mozilla's JS engine.

后两个选项将使用 V8,这是谷歌在 Chrome 背后的 JS 引擎,它也在 Node.js 中实现。第一个选项将使用 Rhino,它是 Mozilla 的 JS 引擎。

回答by Daniel Kec

Yes, you can run a JavaScript file directly from the NetBeans IDE with the Node.jsplugin: Download NodeJS plugin from netbeans.org

是的,您可以使用Node.js插件直接从 NetBeans IDE 运行 JavaScript 文件: 从 netbeans.org 下载 NodeJS 插件