Setup Eclipse IDE on Ubuntu

Install Eclipse IDE

Eclipse is an Open Source multiplatform IDE supporting many program languages and rich functionality to make programming more efficient

Start the Terminal (hit Ctrl+Alt+T)

Run following command to install the Eclipse

sudo apt-get install eclipse eclipse-cdt g++

After the process of getting and installing is completed – start the Eclipse IDE

  • Click on the icon Dash Home UbuntuDashHome and type in the search field “eclipse” – the icon “Eclipse” will be shown


  • In the started Terminal type “eclipse” and hit Enter

After a splash screen of starting Eclipse the dialog “Workspace Launcher” is shown – change the path to a workspace folder (if needed) and click the button OK


Close the opened window with options “Overview”, “Examples”, “Tutorials”, etc.

Create a C++ project with code example

In the IDE main window open the File menu, select items “New”, “C++ Project”

In the “Project name ” field type a name of the project

In the “Project type” tree-view list select an item “Hello World C++ Project” – “Linux GCC” will be selected in the “Toolchains” list


Click on the button “Finish”. The project with one source file is created. This file contains basic code which outputs text “!!!Hello World!!!” on the screen when the application is started.


Build the project

Options how to build a project

1. Hit Ctrl+B to build all projects exist in current workspace (and in the “Project Explorer” window)

2. Click on the icon “Build”  EclipseIconBuildProject (arrow on the right side of the icon allows to select different configurations: “Debug”, “Release”, etc.)


3. Click on main menu item “Project”, select “Build Project”


4. Click right mouse button on the project name in the “Project Explorer” window; select an item “Build Project”



Run the project

Options to run a project

1. Hit Ctrl+F11 to run a project; hit F11 to debug a project

2. Click on main menu item “Run”, select “Run” or “Debug”

3. Click on main menu item “Run”, select “Run As” or “Debug As”, select “Local C/C++ Application”

4. Click on the toolbar icon “Run” EclipseIconRunProject or on the toolbar icon “Debug” EclipseIconDebugProject

5. Click right mouse button on the project name in the “Project Explorer” window, select “Run As” or “Debug As”, select “Local C/C++ Application”

Started application will print the text “!!!Hello World!!!” in the “Console” window.



Try to start the built application outside of Eclipse

Options to run the build application

GNOME Commander

1. Start “GNOME Commander“. If “GNOME Commander” is not installed yet – it can be installed

2. Find the folder where the application was build

3. Double-click on the built executable file – a windows is shown with a text printed by started application


The folder where the application was build can be found in a “Console” tab of Eclipse or in the “Resource” section of properties of the project – click the right mouse button on the project name in the “Project Explorer” windows, select an item “Properties”. The application will be build in a sub-folder “Debug” (or “Release”) of the folder specified in the field “Location”



1. Start the Terminal (hit Ctrl+Alt+T)

2. Set the folder with build application as current (in this example it is “/home/user1/workspace/ExampleCpp1/Debug”)

cd /home/user1/workspace/ExampleCpp1/Debug

3. Check if the build application file exists in this folder (in this example it is “ExampleCpp1”)



4. Create a script to run this application (in this example the application name is “ExampleCpp1”, script name will be “” but it the name can be different – e.g. “”). Type the following command, hit Enter and for each line started with “>” type following lines completing them by hitting the Enter

cat > << END


Check if file exists and contains two entered lines



Allow this script to be executed and look at this folder content

chmod +x



The script is shown with special color defined for files which have permissions to be executed (to be run)

Start the build application by the created script



If this application need to be started from another folder – full path to this application should be defined in the script (the script shown below is already modified)



Start the build application from another folder (in this example – from the home-folder)