Is it possible to do the same as this in Eclipse what he is doing in Intellij IDEA? to run the javascript file in console?
3 Answers
To set up Eclipse to run JavaScript files:
In Eclipse, got to Run > External Tools > External Tool Configurations
Double click on Program to open a new configuration and name your new configuration (ex. Node_Config)
Figure out where you have node.js installed. Paste the results in the 'Location' box in Eclipse. (If you haven't installed node, do so here)
- Mac: in the command line, run
which node
. - Windows: in the command line, run
where node
, or see this for more/different windows advice
- Mac: in the command line, run
Fill in the following:
- Working Directory: ${container_loc}
- Arguments: ${resource_name}
Click apply, and then close.
Now, in the main Eclipse screen, find the play button with a red toolbox (next to the regular play button). When you have a js file open that you want to run, click this and it will be just like running it from your console using node.
-
I have node.js installed, but the command line gives Syntax Error when I try to run 'which node'. – Olga Jun 13 '16 at 11:24
-
I've pasted https://nodejs.org/en/ in Location box, but this config is still unavailable in Run menu options – Olga Jun 13 '16 at 11:25
-
it worked! I've put this C:\Program Files\nodejs\node.exe and it worked! thanks! – Olga Jun 13 '16 at 11:27
-
@Olga I'm so glad! Sorry about the `which node` command - that is mac specific command to find where you have node installed. I chould have asked what you are using. Would you mind marking this as answered? – ebbishop Jun 14 '16 at 17:51
Since Eclipse Neon you can do that. I suggets you that you
- download Eclipse Neon and install Eclipse JEE Neon distribution.
- install node.js.
With Eclipse JEE Neon, you will benefit with Run As / Node.js Application and even with Debug As / Node.js Application:

- 2,027
- 13
- 17
He is using WebStorm which is editor for Front-end dev from same company (JetBrains).

- 1,017
- 12
- 25