Reputation: 333
I want to use Eclipse as my editor for HTML/Javascript files. When I "Run", I would like to see a browser (any one of Internet Explorer, Firefox, etc on Windows) launched for my file. How can I set up a 'run configuration' to do this?
Upvotes: 22
Views: 72335
Reputation: 6160
You could set up an External Tool configuration that, when you run it, would open, in a browser, the document you're currently editing. Instead of "Run", you'd click the button next to the Run button, with the little red suitcase over it.
To set it up, use the menus: Run...External Tools...External Tools Configurations. You'll get a configuration dialog. Now:
Running an External Tool Configuration is a lot like running a Launch Configuration: you can choose from the menus, or use the buttons on the button bar; if you click one of those buttons, it will run the last configuration you selected (on whatever document you're editing).
The important things to note are:
See these docs for more detail.
Upvotes: 24
Reputation: 3636
I have installed aptana studio plugin for eclipse, and that will enable run as "java script web applicaiton" option.
Install aptana studio pluging as follows
install wamp server if you dont have it http://www.wampserver.com/
Upvotes: 1
Reputation: 106
had the same problem, it's really annoying that there is no default behaviour of eclipse to deal with html files.
here is how i did it with pictures! ;)
Upvotes: 3
Reputation: 147
Go to the Main Menu with in the Select --> window -> webbrowser --> Here by default "internal browser will selcted" if you want to change select --> chrome/firefox/ie then you can run the web application project and the result will be displayed in the web browser you selected.
Upvotes: 0
Reputation: 23169
You could install the WTP tools and set up a Static Web Project. Copy your files into that (or you may be able to set up a short cut, I'm not sure). You can change the browser in Preferences->General->Web Browser. Selecting Run with launch the browser and your content.
Eclipse has great refactoring, syntax checking and formatting now for JavaScript, I really recommend it.
Upvotes: 1