In the rest of this lesson we're going to look at eclipse and
try to get more familiar with eclipse in a hands on manner
through a demo. In the demo we will cover some of the
basic aspects of eclipse like how to run eclipse, how to select
their workspace, how to create a project, how to create the class
within the project and so on. I'll also cover some more advanced
aspects, like how to create builders, run your project within Eclipse, and
how to use their Eclipse debugger. So let's get to the demo.
So let's start Eclipse. Eclipse is going to ask me
for the location of my workspace and in this
case, I selected a suitable directory and you can
also use that checkbox on the left to avoid Eclipse
for asking you again about where to put the
workspace. And the workspace is basically the place the
directory. Where, Eclipse will place all of your projects.
So, now when you start Eclipse, if it's the first
time you might get this Welcome screen. It's not going to happen
again on subsequent executions, but I just wanted to make sure
that I covered all the bases. And so, whatcha want to
do here is to basically go to the java perspective
which you can do by clicking over there or you can
also use the menus. So in this case we will have
to go to Window, open Perspective, and if the Perspective is
not here, you'll have to click on Other. And at this point,
that you can click on Java Perspective, then you
click okay. And the perspective is basically, the visual work
space where you will be operating. So, after we selected
perspective, we can actually close the welcome screen. And here,
you see that you have this different areas and on
the left You have the package explorer. This is the
area where your packages will be, you've got a task list,
and an outline on the right which we'll cover later.
And then you have underneath, the bottom, a problems, java
doc and declaration views and we will see some of
these views in actions later. And here in the center
you have the area. Which is called a code editor,
which is where you'll be writing, editing, and modifying, basically,
your code. This is where most of the action takes
place. So let's start by creating a Java project. And
to do that we can use either the context menu, or
you can just use the menu, select new Java project.
You'll be greeted by this, wizard, and. And at this
point in the wizard, you can select the name of
your project. I'm just going to call it a very simple way
my project. And I going to use the default location for
the project, as you can see it will be placed
in the work space that I selected before. I'm going to
also use the default. Java Runtime Environment, which is Java 1.7
in this case. I'm going to keep the selected default layout
and the, then I'm going to go to the next step. Here,
we're first presented with the location of the source code for
our project. The default is a directory SRC in my project
and for the output file, the directory bin. So repeat, we're now
going to change that. Here in case you need other projects to
build your own, then you can specify them here. Here we
are building a simple project, so there's no need for that.
And here we can specify which libraries our project requires. As
you can see, the Java library's already specified. And you can
also add other jars, which can even be External jars. And
finally this is the tab that allows you to specify which
part of you project. So how your project will be exported,
so lets not worry about that for now. Lets click finish.
And as you can see here on the package explorer, my
project appeared. So now we can open the project by clicking
on the triangle right next to it, and as you can
see there is the SRC directory, where my source code will go,
and there's also an indication that we're using the JRE, so that's
the Java system directory within our project. And this is just for people
who are interested in what happens you know, under the hood. So
if you don't care about that, you can just skip this part. So
basically here I'm showing you how we can go to the directory
where the project was created. We can see the bin and src directories.
And there's also some other files here that you can
see these 'dot' files that you will not normally, see. And
those are kind of bookkeeping files. So these are files that
contain information about your project and that are created automatically by
Eclipse. And, for example, will have various indication about the
configuration of the project, some settings and the class path for
the project. And, as I said, you don't have to worry
about this if you just want to go Eclipse as you're never
going to mess with the command line.