Eclipse IDE Quick Start

Beginning Users

See the online videos for quick tutorials:

Eclipse is project-based (not file-based). You must create or import a project before creating or editing source files.

Create a New Project

Select File | New Project...

Click on Prolog and Project

Click Next -> you will see:

Enter the Project name. This is also the name of the directory that will be created in the workspace directory (as you can see in the dimmed Directory box).

Click Finish

Open an Existing Project

Select File | Import...

Click on Existing Project into Workspace

Click Next -> you will see:

Click Browse... and select the directory that contains the project you want to re-open (or type in the pathname).

Click Finish

Create a Source File

Select File | New | File you will see:

Make sure the project you want to create the file in is highlighted.

Enter the File name ending in .pro.

Click Finish

Add an Existing Source File to a Project

Click on the name of a project you want to import the file into in the Navigator View (see below).

Select File | Import | File system you will see:

Click the Browse button on the upper right to navigate to the directory containing the files you want to add to the project.

Tick the box in front of the names of the files (and directories) you want to add to the named project/folder. (You can press the Browse button to the right of "Into folder" to select another project.)

Click Finish

Open a Source File

When you create a new file, it will be opened in the Editor View.

Otherwise, in the Navigator View, double-click on the name of the file you want to edit. It will open in the Editor View.

Type in your code.

Save a Source File

Select File | Save

When you save a file, a new outline is generated and the source file is checked for syntax errors. Check the Problems View to see the errors:

Any errors will be highlighted in your Edit View. You can click on the red boxes in the right margin.

Run a Single Source File

Open a source file for editing (or click on the file name in the Navigator View).

Select Run | Run As | Interpreted Single File (pro)

This start the Prolog Listener in the Listener View:

After the ?- type the goal you want to execute (in this case main.). You can use the arrow keys to retrieve and edit the goals you entered previously.

Type debug. to use the classic box-model debugger.

Type quit. to exit.

Debug a Single Source File

Open a source file for editing (or click on the file name in the Navigator View).

Select Run | Debug As | Interpreted Single File (pro)

This opens the Debug Perspective (you were previously in the Prolog Perspective):

After the ?- type the goal you want to debug (in this case 'main.' followed by the command 'goto(yard).'.) The currently executing line is highlighted with a C for call, R for redo, F for fail, E for exit and I for info. Pausing at each of those debug ports is controlled by the buttons in the Debug View.

The use the buttons in the Debug View in the upper left to run, suspend, stop and step your program. This view also displays the Prolog call stack.

The Variables View in the upper right shows your variable bindings at each level of the call stack.

To set a breakpoint, double-click in the left margin of the source file (see the blue dot).

Press or type quit. to exit. Type [Ctrl]-C to break user input.

Click on the paw in the left margin of the Eclipse Window to return to the Prolog Perspective.

Advanced Users

Create a Project with Existing Source Files

Select File | New Project...

Click on Prolog and Project

Click Next -> you will see:

Uncheck the Use default box.

Click Browse... to locate the directory containing the .pro source files you want in the new project.

Click Finish

This creates .project, build.properties and amzi.cfg files in the specified directory and opens the project in the workspace.

Right-click on the project name and select Refresh to see the existing files in the Navigator View.

Run a Multiple File Project

In the Prolog Perspective, click on the project name.

Select Run | Run As | Interpreted Project (pro)

Debug a Multiple File Project

In the Prolog Perspective, click on the project name.

Select Run | Run As | Interpreted Project (pro)

Set Project Properties

Select Project | Properties or right-click on the project name in the Navigator View.

Click on Build Executable/Libraries. You will see:

Default Output Folder -- the folder where plm (compiled) and xpl (compiled and linked) files are generated.

Executable File Type -- use Debug for debugging compiled or remote projects. Use Release to ship your code.

Executable File or Path Name -- the name of the xpl file in the Default Output Folder, or the fullpathname to the xpl file.

List of Source Files to Exclude -- utility and test files to exclude from the build and run/debug sessions.

Prolog Libraries -- the Prolog libraries to link into your xpl file.

Runtime Logic Server Extensions -- the lsx files to load at runtime. Note, you will need to load these by calling the Logic Server API or using an amzi.cfg file when you ship your code.

Build Project

Right-click on the project name, select Build Project or select Project | Rebuild All

Any errors will be displayed in the Task View.

Run Compiled Project Select Run | Run As | Compiled Project (xpl)
Debug Compiled Project

Set Project Properties, Executable Build Type to debug.

Rebuild the project.

Select Run | Debug As | Compiled Project (xpl)

Run a Cross Reference on a Project Select an open editor or a project on the Navigator View. Then click on the Cross Reference View and click on the Refresh button or select Refresh on the menu.

Copyright ©1987-2011 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server is a trademark of Amzi! inc.