Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my .js files launching in gedit from eclipse?

From the explorer view in Eclipse, whenever I try to open a .js file, it launches in gedit instead? When I try 'right click > open with > text editor' it opens in eclipse but without any colour recognition for the syntax.

All other files work fine (html, py, css). This is driving me crazy!!

UPDATE These are the packages I have installed at the moment

  1. Eclipse IDE for Java Developers
  2. Eclipse Web Developer Tools
  3. Javascript Development Tools
  4. PyDev for Eclipse
  5. Web Page Editor (Optional)
like image 996
super9 Avatar asked Jun 03 '11 14:06

super9


People also ask

How run JS file in eclipse?

To run JavaScript program code in Eclipse, right-click on myJavascriptProgram and navigate to New -> Open with -> web browser and click on it as shown below. Eclipse will open the web browser in the editor and display the following output.

Does Eclipse IDE support JavaScript?

Use Eclipse IDE for Web and JavaScript developers! Use Eclipse Wild Web Developer plugin! It just works!


1 Answers

Go to the general preferences of eclipse and search for "file associations". There, ensure that "JavaScript Editor" is set for *.js. After that eclipse should open the js files with this editor and bring code highlighting and stuff like that. Be aware, that those files you opened with 'right click > open with > text editor' might have their own setting and will still open up in Text Editor. Choose there "default" again to remove this local setting for the file.

The JavaScript Editor is included in the plugins you mentioned!

like image 75
strauberry Avatar answered Oct 02 '22 18:10

strauberry