Question

Eclipse Juno keeps opening my HTML files in a embedded web-browser, rather than in an embedded syntax-highlighting editor.

I have installed:

  • Web Page Editor
  • Eclipse Web Developer Tools
  • PyDev for Eclipse

Specifically see the screenshot of my install applications.

I need it to work with Django templates + any other Python templates with HTML + normal HTML+JS files.

How do I find this editor, and select it as default?

Was it helpful?

Solution 7

Nothing worked and I had begun getting an unrelated error on startup with a troubleshooting step requiring reinstall.

This time I downloaded Eclipse for Mobile Developers, and since then I have added my other packages and it's all working fine =).

None of the editors work the way I want them to though, however I have ended up with Django-Editor (which is slightly better than Aptana's one).

OTHER TIPS

Select Window -> Preferences from the main Eclipse menu.

Select General -> Editors -> File Associations from the Preferences menu.

enter image description here

For .htm and .html, left click on the extension in the upper view. Left click on the Add button to the right of the lower view to add one or more HTML editors. Left click on your favorite HTML editor and left click on the Default button to make it the default editor.

If the extension you want is missing, left click on the Add button to the right of the upper view to add the extension.

If you want to add an HTML editor to Eclipse:

  1. Go to Help -> Install New Software
  2. Choose the site http://download.eclipse.org/releases/your_eclipse_version
  3. Type the filter text Web Page Editor
  4. There should be one result. Check off the box and press the Finish button.

Installing the web page editor

Now you should have the option to choose the HTML editor when opening files by right-clicking, Open With -> HTML Editor.

If you want to always use the HTML editor to open HTML files then go to the Eclipse preferences -> General -> Editors -> File Associations. Select the extension up top (e.g. *.htm, *.html) then select the HTML editor in the bottom pane and press the Default button.

Making HTML editor the default

I had a similar problem. Once I installed the html editor (thanks to CgodLEY), still my html files wouldnt show up with that editor. Solution? Right click on the html/htm file, go to "open with" and select "HTML editor". Fortunately that solve everything...

For those still finding their way here, yes, do add an HTML editor to Eclipse as CgodLEY suggests, if you're having this problem. However, even if you already have an HTML editor in your Eclipse installation, consider installing CodeMix for a superlative HTML editing experience - take a look at the differences here.

Now, there's a Django-aware template editor available for free:

http://eclipse.kacprzak.org/

I installed it in Eclipse Kepler / Django 1.6, it's working fine for me.

Note: if you previously opened a specific .HTML file with some other editor, you need to go back to the project view, right click on the .HTML file, select 'open with...' and explicitly select Django editor.

To answer the opening of your question: Note that Eclipse will use the built-in web-browser to view html files if you are opening them outside of a project, as in "File->Open File ...", when that file isn't part of a project.

I just created a dummy project, and now the html files are correctly opened with the editor selected in my preferences. Success!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top