eclipse-ganymede

This guide will show beginner programmers how to set up and install JDK and the Eclipse IDE. I will be installing JDK 6 Update 7 and Eclipse 3.4.0 Ganymede.

Get JDK

Mac Users: Skip this as you already have JDK. Do a system update to check if you have latest one.

You will need to install JDK first by going to Java SE Downloads and choose “Java x Update y” where x is the latest version of Java and y is the latest non-beta update. (Do not get the version with NetBeans or Java EE unless you know what youre doing.) Installation is straightforward, but it may take some time. Go grab a coffee.

Get Eclipse

You can go to Eclipse.org’s Download Section and choose “Eclipse IDE for Java Developers.” Extract the contents of the zip file to wherever you wish.

Setting Up

Once you fire up Eclipse, it will ask you for a path to your workspace. This folder will contain all of the projects you create with Eclipse as subdirectories.

Once that’s done Eclipse will greet you with a Welcome window. Just click on “Go to Workbench” at the far right and you’ll never need to see this screen again.

Now we will make sure that Eclipse is using the Java SDK you just downloaded. Click Window > Preferences. Then, on the left panel expand Java, then click on Installed JREs. Make sure that the version of Java you installed is there and checked. If there are multiple items then, unless you plan to use them all, check only the version you downloaded.

If your version is not there, then click Add, choose Standard VM, and click next. Browse to X:\Program Files\Java\jreX.X.X_XX and everything should be filled out automatically. Click Finish.

Also make sure that the compliance level is set up properly. Click “Compiler” under “Java” and check the Compiler Compliance Level. If you are using JDK 6, then choose “1.6″ in the drop down menu. If you are using JDK 5 for some reason, then choose 1.5. Etc.

Testing Eclipse

Click File > New > Java Project and let’s make a simple HelloWorld project. Notice the workspace path and JRE that is being used. Then click Finish.

Create a class HelloWorld by clicking on the HelloWorld project folder on the left and clicking the “C+” icon in the toolbar. Name the new class HelloWorld and click Finish.

Paste the following code into HelloWorld.java.

public class HelloWorld
{
public static void main (String[] args)
{
System.out.println(“Hello Eclipse!”);
}
}

Then, click Run in the toolbar. The console at the bottom should say “Hello Eclipse!”

Additional Resources:

Dr. Java is a slimmer IDE that focuses on only the essentials. Try it if you need a more lightweight IDE. Also available for Mac OS X.

The Java SE 6 Documentation