Tip:
Highlight text to annotate it
X
{QTtext}{timescale:100}{font:Verdana}{size:20}{backColor:0,0,0} {textColor:65280,65280,65280}{width:960}{justify:center}
{plain}
[00:00:00.63] In this movie, we'll take a
first look at a Java-Editor.
[00:00:03.37] Note that we've copied this file HelloWorld.java
into the Exercise Files from Chapter 2.
[00:00:09.90] Eclipse requires that all
Java files being a Java project.
[00:00:13.82] To create a Java project, we use the
context menu, New and Java Project.
[00:00:18.93] Give the Project a name and we'll select all
the defaults, select Finish and we have a Project.
[00:00:25.92] A Java requirement is that all Java-class
files exist within a namespace.
[00:00:32.04] This namespace is encapsulated by a package.
[00:00:35.24] In order to create a package what we do
is; we use the context menu,
[00:00:40.07] same New and Package, and we'll give this
the name com.charleskelly.hello, select Finish.
[00:00:46.92] Now what we'll do is we'll take this
HelloWorld.java file from our previous project,
[00:00:51.89] copy it, and paste it,
into this package.
[00:00:56.53] If we expand the package, we see the
HelloWorld.java file, we can double-click on it,
[00:01:00.95] and we can see the file.
[00:01:02.71] We are not going to do any programming
right now, but what we'd like to do is see
[00:01:06.87] if we have a file that contains a
valid Java class file, we can run that
[00:01:12.19] from within Eclipse.
[00:01:13.72] In order to do this, we select the
context menu, select Run As,
[00:01:19.12] and run this as a Java Application.
[00:01:20.12] And as you'll see, HelloWorld is
printed here in the Console view.
[00:01:25.84] Alternatively, what we could've done is
used these buttons here: Debug, Run, etcetera.
[00:01:33.27] If we select Run, the same thing happens;
[00:01:36.45] HelloWorld is presented in the Console view.
[00:01:39.81] The idea of a HelloWorld program comes
from the 1970s and the C language,
[00:01:44.47] when it's author Brian Kernighan established
Hello World as a method of determining
[00:01:49.54] whether a valid file could be created,
and whether that file could run
[00:01:54.65] on a particular computer.
[00:01:56.02] If you follow these steps and you
see HelloWorld in your Console view,
[00:02:00.26] you'll know that your Eclipse version is properly
configured and you can run Java programs.
[00:02:06.66]