1. Install the Sample Application
- Click js_mario.zip to download the archive containing the JS_Mario web project. Save the archive to your local file system.
- In MyEclipse, select File>Import, expand General, and select Existing Projects into Workspace. Click Next.
- Choose the Select archive file option, browse to the location of the downloaded js_mario.zip archive, and select it.
- Click Finish to complete the import process.
Importing the JS_Mario project
- Because this project was created with an older version of MyEclipse, a Project Migration wizard opens. Complete the wizard to migrate the project.
JS_Mario project structure
HTML Web Designer or the JSP Web Designer. In any of these
(often referred to as the editor gutter).
a <script> element.
- Double-click the runmario.html file in the Explorer to open it in the HTML Web Designer.
- Right-click the editor margin at line #9, and
Toggle Breakpoints, or double-click the margin to create a
breakpoint icon, or right-click the breakpoint, and select
3. Launch and Debug the Source
Right-click runmario.html in the Explorer, and select
- Click on the Debug view toolbar to move the execution context to the next executable source line. In this example, line #9 transfers control to the enableAnimation() function in the mario.js file.
Debug context opens the mario.js source file
- Before advancing, set a breakpoint in the makeRun() function of mario.js.
- Click to run to the next breakpoint.
The Debugger stops in the makeRun() function.
Debugger stopped at makeRun() function
- Remove the breakpoint, and click to continue execution. Notice the animation occurs when execution completes.
configuration to execute deployed web application resources
- Deploy the JS_Mario project to the MyEclipse Tomcat server.
- Right-click runmario.html in the Explorer, and select Debug As>Debug Configurations.
- Type runmario on localhost in the configuration Name field, select the URL option, and type http://localhost:8080/JS_Mario/runmario.html in the Debug Target path field.
Mario Launch configuration
- Click Debug to launch the MyEclipse AJAX Web Browser for debugging, just as in section 3 while debugging the file locally.
application/web server behaves identically to the file-based
debugging detailed in section 3. Additionally, although
this particular server debugging example used an HTML file, a JSP
same way, as long as the URL in the launch configuration is
Local Source Files
based on another description language. Debugging these
applications, as well as other applications for which there is no
local source, requires special tactics. The Instant-On
debugging feature allows you to debug these applications as well
they work without having to make a local copy. The steps below use Google Maps to illustrate this feature.
- Click to open the AJAX Web Browser, and type http://maps.google.com in the address bar.
- Click on the AJAX Web Browser toolbar.
Note: You must use the MyEclipse AJAX Web Browser to navigate to the web page you’d like to debug. Other Web browsers do not support instant-on debugging.
session started for Google Maps. But, a debug session
alone doesn’t help you understand the application. You still
Scripts Inspector view into focus. It is included in the
default Debug perspective, so if you don’t see it, select
Window>Reset Perspective to open it.
files that comprise the Google Maps application. If you select one
of these scripts and expand the tree, you see the individual
functions that make up the file. By double-clicking or selecting
one of the top level files or methods, you can open an editor on
that method or file.
When you have an editor open on the remote script, you can add
Below is a list of debugging actions that are currently not available in MyEclipse.
- Run-To-Line capability
- Conditional breakpoints
- Setting source path lookup for Launch configurations
- Exceptions in the Variables view
- Variables sorting in Variables view