Download Eclipse from http://www.eclipse.org/downloads/.
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.
How do I write a simple "Hello World" program?
To write a "Hello World" program follow these steps:
- Start Eclipse.
- Create a new Java Project:
File → New → Java Project.
- Enter a project name into the
Project namefield, for example,
Hello World Project.
Finish--It may ask you if you want the Java perspective to open. (You do.)
- Create a new Java class:
File → New → Class(or click the
New Java Classbutton in the toolbar).
HelloWorld(no space between words) into the
- Click the checkbox indicating that you would like Eclipse to create a
public static void main(String args)method.
- A Java editor for
HelloWorld.javawill open. In the main method, replace the comment with the following line.
- Save using ctrl-s. This automatically compiles
Run → Run As → Java Application. The console will open and display
- After the first time, you can run the program by clicking the
Runbutton in the toolbar (white triangle in a green disc).
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
menu and choose
Help Contents. From there you can go
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.
To create a test file for your program, go to
File→ New → JUnit
Test Case Pay special attention to this Eclipse tutorial:
→ . If it asks, tell it you want to
add JUnit 4 to your build path. Then if you choose
Eclipse will offer to write JUnit test stubs for all the methods you