2

I am learning JavaScript at the moment and have just installed the Eclipse IDE for JavaScript Web Developers. I have created a new project and created a new file with an extension of .js.

I have another Eclipse version which I purely use it for Python and normally, when I run the script, I am able to see the output in the console right away. But this is not the case here as whenever I try to run the following script,

var myfruits = [ 'apple', 'orange', 'mango'];
console.log(myfruits);

I end up with this Unable to Launch message: enter image description here

What am I missing?

2 Answers 2

1

Well I would say that Eclipse is a poor tool for JavaScript development but then I don't like Eclipse nor Java.

Opinions aside, you need to remember that JavaScript was designed as a scripting tool to be embedded in other environments, primarily in web pages.

So to do what you want, you need to create an HTML page with the JavaScript file referenced as a script.

The alternative approach is to use Node.JS to host your JavaScript instead of a browser. You can use the Nodeclipse project for this.

If you are not wedded to Eclipse, there are plenty of other options. My current choice is Adobe's Brackets. This is an editor rather than a full IDE however but it is built around Node.JS so you can run JavaScript from within the editor.

0

Rather than using a very old version of Eclipse IDE (indigo is 5 to 6 years old), it's recommended to download the latest version of Eclipse IDE and add to in the "JavaScript development tools" that you can find via "Help > Install Software...". Additionally, you can browse Marketplace for additions that will also help you. Extensions such as Enide or Tern.java really improve the experience of developing JS inside Eclipse IDE.

For the next version (Neon, June 2016), a lot of effort was routed to improving JS development in Eclipse IDE. You'll soon be able to see major improvements "out-of-the-box".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .