You are on page 1of 5

Cody Stamps

Software Engineering I

Eclipse Manual


For program developers that have used IDE such as JCreator, Visual Studio, BlueJ, etc., having to
use learn another IDE can be a pain. Eclipse is a very powerful Java IDE. It can make one feel
apprehensive about using it. However, I hope this manual will show you some key features and
how to use them within eclipse. The code is still the same (Java) but the environment is
different. So before the key features are valuable to a programmer, a basic knowledge of java is
needed. Aside from that, let’s get started with one of the most valuable (in my opinion)
features: Code Completion.

Section 1: Code Completion

Code completion helps to trim down programmer error and also helps to shave the time it
takes to actually write code. The user can set up Eclipse to show possible commands and have
the user scroll through them and select the appropriate code. Think about it as auto texting on
a cell phone.
Here we can see a menu that Eclipse has populated of methods that can be used for padre.
here. As a programmer writes a class and methods, Eclipse will keep track of what each class
can do. It helps make coding easier.

Section 2 : Quick fix for syntax errors

Eclipse really shines when it comes to helping a programmer figure out those pesky syntax
errors. The errors generated by compiling or running the program are harder to solve than
others at times, but with a quick-fix feature in Eclipse, fixing these errors can be as easy as a
click of the button.

Let’s say that you, the programmer, want to create a line of code that creates a Student object
that takes a name variable. You write this (and yes it is incorrect on purpose.):
Student stud = new Student();

The error here is that a name variable is not passed through Student(). Upon running the
program Eclipse is going to give you a red squiggly line under the segment of code above as
seen below.

Upon clicking the red squiggly, the error appears.

Maybe we meant to define a student with a name or maybe we meant to have a constructor of
Student that does not need a variable. Upon clicking the available options we can do multiple
things. We can let Eclipse create a constructor to match, add a name variable to Student(), or
modify the previous constructor to match.

Section 3: Running an application in the Debugger

A debugger is a valuable tool for programmers in that it helps us to see step by step the road
map of code we have written and see where we may have messed up and that it is not a syntax
error. This has to do more with fixing logical errors.

First we must set Eclipse up to know that we are going to be debugging by clicking the icon.

We will want to choose Debug As > Java Application.

After we have entered the Debugging environment, we need to set up break points which tell
the debugger to stop at the point without continuing to process the code.

We do this by right clicking in the side of the environment and choosing toggle breakpoint.
From here we can choose to step into (meaning if it is another method that the programmer
wrote, the debugger will take you through the lines of code and show a step-by-step execution
of that code) or we can step over to the next line of code in line with the breakpoint and it will
continue until the next breakpoint or end of code.

While going through any code in the debugger we have the ability to see what the current value
of any variable is at any moment. This allows us to calculate our any possible logical errors as
we go. The variables are shown in this tabbed box:
Section 4: Refactoring the code

To refactor code in Eclipse means that the programmer is essentially changing the appearance
and understanding of the code without changing what the code actually does. It can be used to
change the structure, but it could also introduce errors so refactoring must be used with
caution. A very cool feature is it can determine whether a set of code could be divided into it’s
on method.

Refactoring options can be found by right-clicking a high-lighted section.

You can do things like change the signature (which will change any instances of the signature
throughout the whole program for you), move the segment of code, rename, etc.