Getting Started with Eclipse
  Fall 2016 , David Matuszek

Downloading and installing

Download Eclipse from

The version I'm using is Eclipse IDE for Java Developers . The latest version in October 2016 is "Neon"; use a newer version if one becomes available.

Installation is simple, but you must already have the Java SDK installed.

Getting started

How do I write a simple "Hello World" program?

To write a "Hello World" program follow these steps:

  1. Start Eclipse.
  2. Create a new Java Project:
    1. File → New → Java Project.
    2. Enter a project name into the Project name field, for example, Hello World Project.
    3. Click Finish--It may ask you if you want the Java perspective to open. (You do.)
  3. Create a new Java class:
    1. File → New → Class (or click the New Java Class button in the toolbar).
    2. Enter hello into the Package field.
    3. Enter HelloWorld (no space between words) into the Name field.
    4. Click the checkbox indicating that you would like Eclipse to create a public static void main(String[] args) method.
    5. Click Finish.
  4. A Java editor for will open. In the main method, replace the comment with the following line.
         System.out.println("Hello World");
  5. Save using ctrl-s. This automatically compiles
  6. Choose Run → Run As → Java Application. The console will open and display Hello World.
  7. After the first time, you can run the program by clicking the Run button in the toolbar (white triangle in a green disc).

Using the tutorials

The tutorials are online, and I haven't found an easy way to download them so that they can be used offline.

To start a tutorial, first start up Eclipse. Go to the Help menu and choose Help Contents. From there you can go to Workbench User Guide → Getting Started → Basic Tutorial. You can explore all the fancy features of Eclipse later, if you want to; many of them can save you a lot of typing.

Using JUnit 4

To create a test file for your program, go to File→ New → JUnit Test Case Pay special attention to this Eclipse tutorial: Help → Help ContentsJava Development User GuideGetting StartedBasic tutorialWriting and running JUnit tests. If it asks, tell it you want to add JUnit 4 to your build path. Then if you choose Next, Eclipse will offer to write JUnit test stubs for all the methods you select.