Before continuing, make sure you have installed:
- A D compiler (DMD, GDC, LDC)
- dub (D’s package manager)
1. Open Eclise
Open eclipse. You will be presented the following screen (or similar, if you ‘re using a different version).
eclipse Mars 1 welcome screen
2. Install the DDT plugin
Install the DDT plugin by following the instructions here
3. Create a project
3.1 Create project
To create a new project, select
File → New → Project...
3.2 Select project type
Expand the D section and select DUB project
3.3 Set project name
Enter a name for the project
That’s it, the project has been created!
4. Configure the plugin
By default, the editor does not show auto-completion as you type (only when you press .
To enable it, select
Window → Preferences
Expand DDT and then Editor from the menu on the left. Check
Enable alphabetic characters as trigger.
Enable alphabetic characters as trigger to enable syntax auto-completion as you type.
5. Run the project
To run the project, select
Run → Run
However, the first time you try to run, an error will occur “The selection cannot be launched, and there are no recent launches.”. To fix this, select
Run → Run As → D Application.
6. Debug the project
Eclipse can debug D applications and provides a nice GUI for viewing the call stack, values of variables etc.
6.1 Setting a break point
To set a break point, double click on the desired line number in the editor.
To debug, select
Run → Debug. Eclipse will prompt you to switch to debugging mode – select yes.
Eclipse’s debug perspective. Call stack is located at the top left, values of variables at the top right.