Formatting Object Model Reference > Creating a Development Environment with Eclipse > Running PTC ALD from Eclipse
  
Running PTC ALD from Eclipse
This section details a method of running an PTC ALD JavaScript template in Eclipse. Currently it is not possible to run JavaScript without a template. Note that this is a suggested method — you may find an alternative that better suits your purposes.
This method uses an Eclipse feature to start PTC ALD and an PTC ALD feature that opens a JavaScript file in a template provided in the install folder. This ex_map_js.3f template is used when you open a JavaScript file in PTC ALD with no document open. The template and method were introduced in release 10.0 M030. To use an alternative template, refer to startwin.3ad.
You may need to make a change to the JavaScript template to work with XML data. If so, use the following steps. The steps shown here use the supplied sample template file APP-install /ex_map_templates/ex_map_js.3f:
1. Create a copy of the ex_map_js.3f template file.
2. Open the ex_map_js.3f template in PTC ALD without running the autoexec script.
3. In Document > Preferences > Document, navigate to the XML Parse tab. Activate the following options:
Ignore missing <?xml …> declaration
Ignore undefined entity references
Replace undefined entity references
4. Save the template (as a template)
In Eclipse, create a run configuration to invoke PTC ALD and open the current JavaScript file you have open in Eclipse. To do this, follow the following steps:
1. Select the Run > External Tools > External Tools Configuration menu option.
2. Select Program and click the New button to create a new configuration
3. Complete the fields on the Main tab:
Location — reference the PTC ALD executable in the install folder
Working Directory — leave blank
Arguments — enter the string “${resource_loc}” (including double quotes).
This is an Eclipse variable that points to the currently selected script.
Click Apply to save the settings and close the dialog.
This configuration will run PTC ALD (unless it is already open) and open the current JavaScript file you have open in Eclipse.
To use this configuration, click on the Run External Tools icon in the Eclipse UI.