最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why are my .js files launching in gedit from eclipse? - Stack Overflow

programmeradmin1浏览0评论

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)

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)
Share Improve this question edited Jun 3, 2011 at 14:29 super9 asked Jun 3, 2011 at 14:08 super9super9 30.1k41 gold badges124 silver badges172 bronze badges 3
  • I think support for JavaScript es from a plugin in Eclipse. If such a plugin is installed, you have a dedicated JavaScript Editor you can associate the .js files with. – Laurent Pireyn Commented Jun 3, 2011 at 14:12
  • Do you know which plugins I need? – super9 Commented Jun 3, 2011 at 14:22
  • I haven't used Eclipse in months. Try google./search?q=eclipse+plugin+javascript – Laurent Pireyn Commented Jun 3, 2011 at 14:25
Add a ment  | 

1 Answer 1

Reset to default 8

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!

发布评论

评论列表(0)

  1. 暂无评论