Setting Up Your Personal Development Environment (Eclipse)

Steven Zeil

Contents:

1 Overview

This page walks you through the essential steps of setting up an IDE and a set of compilers on your own PC.

2 Preparation

An IDE (Integrated Development Environment) is a program that provides support for coding, testing, and debugging, and possibly other software development activities.

This should not be confused with a compiler, a program that translates programming source code into an executable form. An IDE serves as a convenient interface to a compiler, but also provides access to an editor, a debugger, and other tools as well.

Similarly,

Before setting up a development environment on your own PC, you need to consider

  1. What programming language(s) do you want to support?
  2. Which is more important to you, ease of installation or the ability of the IDE to grow with you as your programming skills increase?

The major programming languages in use in our Dept are C++ and Java. I’m going to assume that you want support for one or both of these.

The IDEs I recommend to most students are

Both Code::Blocks and Eclipse are free. Both can be used on Windows, Linux, and OS/X machines.

3 Installing Code::Blocks

3.1 Install Your C++ Compiler

As a general rule, you will need to install

3.1.1 Linux

Get the latest available g++ compiler suite according to the usual procedure for installing packages on your system. This should be easy.

3.1.2 Mac

g++ is no longer available as an official Apple distribution. However, you can obtain the clang C++ compiler, a worthy “competitor” to g++ that has a very loyal following, in a package called “Command Line Tools for XCode” available from Apple’s developer Site.

3.1.3 Windows

You have three main options here.

  1. Skip this step. Code::Blocks for Windows comes in two different distribution packages: One includes a copy of the MinGW compiler in the package. The other does not.

    The advantage of using the package with the built-in compiler is ease of installation. The main disadvantage is that you will then need to update or re-install the entire Code::Blocks package to update your compiler.

  2. The CygWin package provides a Posix layer in Windows, allowing much Unix software to be compiled and run without modification. When you install CygWin, you get a good command shell (bash). The g++ compiler can also be selected from the CygWin setup utility.

    A disadvantage of CygWin is that the compiler produces code that relies on the Posix layer, which in turn is provided by a CygWin DLL. Binary executables produced by the CygWin port of g++ can only be run on other machines that have a copy of that DLL.

  3. MinGW, a “spin-off” project from CygWin, provides an alternate port of the g++ compiler that works without a special DLL. You may have used this already, as this is the g++ typically shipped with Code::Blocks and other basic Windows IDEs.

If you choose to install either the CygWin or MinGW compilers, go to their respective web pages and follow the installation instructions there.

3.2 Install Code::Blocks

Go to the Code::Blocks site and follow the instructions to download and install.

Run the downloaded program to install it.

4 Installing Eclipse

4.1 Install Your Compilers

4.1.1 Java

Java is distributted as a JRE (Java Runtime Environment) package for people who want to run Java programs but not write them, and as a JDK (Java Development Kit) package for those who want to write and compile Java programs. (Confusingly, the JDK is sometimes referred to as an SE package.)

You need at least a JRE to run Eclipse. You need a JDK to program in Java. If you aren’t sure, I recommend getting the JDK. Get it from Oracle here and run to install.

4.2 Install Eclipse

4.3 Optional: Add C++ Support

You may already be somewhat familiar with the Eclipse IDE that we will use as a platform for the rest of this semester. If not, this will be your opportunity to learn how to use it.

You may do the following steps in either order:

  1. Do the labs Java Projects in Eclipse, Refactoring Java Code in Eclipse, and Debugging Java with Eclipse from the CS382 website.

  2. Return to CS252 and do the two Eclipse-oriented Try This exercises in Program Development under X and Debugging under X.

5 Setting Up Your Personal Development Environment

Although Eclipse is available on both the CS Windows and Linux machines, over the course of this semester you will be working with a number of updates and extensions for Eclipse and so will need an Eclipse installation of your own where you can install these.

5.1 Choosing your platform

You want to choose a platform on which you will be comfortable doing development work, and which you will be able to use during team meetings in Hangouts. You might eventualy prefer to have multiple development environments to take advantage of the what machines you have available at differnet times and at different places.

I expect most students will choose to do this on their own PCs. The operating system is not critical: you can do everything we need in this course on Windows, Linux, or OS/X.

5.2 Compilers

You will need to have a Java 7 or 8 compiler and a C++ compiler. If you have opted to work on our CS Dept Linux servers, these are already available.

If you are installing on your own machine, Java should be fairly easy to obtain and install. You want the Java 7/8 JDK.

C++ may be more of a challenge, depending on your platform. As a general rule, you will need to install

5.2.1 Linux

Get the latest available g++ compiler suite according to the usual procedure for installing packages on your system. This should be easy.

5.2.2 Mac

g++ is no longer available as an official Apple distribution. However, you can obtain the clang C++ compiler, a worthy “competitor” to g++ that has a very loyal following, in a package called “Command Line Tools for XCode” available from Apple’s developer Site.

5.2.3 Windows

You have two main options here. The CygWin package provides a Posix layer in Windows, allowing much Unix software to be compiled and run without modification. When you install CygWin, you get a good command shell (bash), which may make a lot of things easier later in the semester. The g++ compiler can also be selected from the CygWin setup utility.

A disadvantage of CygWin is that the compiler produces code that relies on the Posix layer, which in turn is provided by a CygWin DLL. Binary executables produced by the CygWin port of g++ can only be run on other machines that have a copy of that DLL.

MinGW, a “spin-off” project from CygWin, provides an alternate port of the g++ compiler that works without a special DLL. You may have used this already, as this is the g++ typically shipped with Code::Blocks and other basic Windows IDEs.

Eclipse should work well with either the CygWin or MinGW compilers.

5.3 Checking Your Compilers

It’s a good idea to check your installation of the compiler suites by issuing the following commands from a shell/cmd window:

javac -version
g++ --version
gdb --version
make --version

5.4 Eclipse

Get Eclipse for your platform from the Eclipse Foundation. If you have chosen to work on a CS Dept. machine, you should still do this, but install somewhere in your own account area.

You will find that the download page offers a bewildering variety of alternate packages. Don’t worry too much about that. You can start with a basic Eclipse installation, then add extension modules to provide the particular features that you want.

  1. Start by downloading and installing the standard Eclipse distribution (a.k.a., Eclipse IDE for Java Developers).

    Use some of the Java code you worked with in the Preparation section to verify that you are able to compile, run, and debug Java code form your new installation.

  2. From the Eclipse Help menu, select Install new software.... Search “All Available Sites” for “C++” (Note, the search is really slow. Be patient.) or scroll down to “Programming Languages”. You want the “C/C++ Development Tools” and the “C/C++ Library API Documentation…”. Follow the on-screen instructions to install these.

  3. Go through some of your old C++ projects from your earlier courses. Pick one that involves two or more .cpp files and at least one .h file. Prove that your installation works by compiling and running that code.

  4. Compose a short README.txt file describing the platform that you chose to install on, what Java and C++ compiler versions you wound up working with, and indicate whether there were any parts of this assignment that were particularly difficult or tricky for you.

  5. In the Eclipse Help menu, select “Installation Details”, then go to the “Configuration” tab. Copy and paste the text of the configuration report from that tab onto the end of your README.txt file and save it.

6 What to Turn In

You will submit the README.txt file and the .cproject file from the C++ project that you created above.

When you are ready to submit your assignment, go here.