views:

56

answers:

3

I've just downloaded Eclipse IDE for JavaScript Web Developers and can't figure out how to run or debug a standalone javascript program using it. Presumably I have to set up a server of some kind? Any idea where the documenation might be?

A: 

There are a few javascript debugger plugins for Eclipse, but I don't think that's generally what people use.

Generally (since the javascript is running in the browser, and each browser behaves differently), you'll run and debug in the browser.

For javascript debugging, I use:

  • Firefox: Firebug
  • IE8: built-in developer tools (F12)
  • Safari: built-in developer tools (enable the menu in prefs, then enable the JS debugger)
  • Google Chrome: based on webkit, the JS debugger is nearly identical to Safari's

On the eclipse side, it really depends on what you're writing. If you're just making a web page with some contained javascript, perhaps eclipse isn't the right tool for you. It'll work, but it's probably overkill. I'd suggest something like Dreamweaver, or some other website authoring program.

Generally Eclipse is used for building compiled applications (Java web apps, Java standalone apps, etc, etc).

I use Eclipse for javascript every day, but it's in the scope of building a Java web application. I use the "Eclipse IDE for Java EE Developers" build. This contains the WTP tools, which has Javascript support. It also includes support for debugging java code in your tomcat or other servlet container (and deploying all your javascript, html, jsp, etc to your application server).

desau
A: 

I found this the other day which I found helpful to get the debugger going:

http://code.google.com/p/jsdt/wiki/HowToStart

Dean Burge
A: 

The documentation for the JSDT is available at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.wst.jsdt.doc/started/overview.html

I found this link and some additional resources at http://kellicker.wordpress.com/2010/08/17/jsdt-resources/

If your stand-alone script is intended to be processed by web browsers, your best bet is to use Google's JsTestDriver. It will allow to have your code executed in different browsrers, and, at the same time, launch the execution of tests and and get its results report from within Eclipse.

Disclaimer: I'm new to JSDT and JsTestDriver, and my attempts to use the JsTestDriver Eclipse plugin have been failing all this morning...

Xv