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.- Click
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 theNew Java Classbutton in the toolbar).- Enter
hellointo thePackagefield.- Enter
HelloWorld(no space between words) into theNamefield.- Click the checkbox indicating that you would like Eclipse to create a
public static void main(String[] args)method.- Click
Finish.- A Java editor for
HelloWorld.javawill open. In the main method, replace the comment with the following line.
System.out.println("Hello World");- Save using ctrl-s. This automatically compiles
HelloWorld.java.- Choose
Run → Run As → Java Application. The console will open and displayHello World.- 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 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.
To create a test file for your program, go to File→ New → JUnit
Test Case Pay special attention to this Eclipse tutorial: Help
→ . 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.