Eclipse is an open source Java IDE, that is easy to use and saves developer's time. Following is a step by step guide for beginners using Eclipse and Java.
Step 1: Installing Eclipse
Go to the website http://www.eclipse.org/downloads/
Select the Eclipse for Java Developers based on your computer (Windows 32 bit or Windows 64 bit). You can check what Windows you have by going to Control Panel > System and Security > System, and then check the System Type.
Click on the download button to start downloading the Eclipse software.
In the File Download window, click on the Save button. This will start downloading the Zipped file and save it in the specified folder.
Go to the folder where you save the downloaded file. Right click on the downloaded file (eclipse-java-helios-win32.zip), select the option Extract Here.
Once the files are extracted, you should see an Eclipse folder.
Following is a 2 min vedio clip providing step-by-step instructions on installting Eclipse for Java programming.
Step 2: Configure Eclipse Eclipse is used to write and compile code to create games and software. To start Eclipse, click on (Eclipse.exe) in the Eclipse folder. The Eclipse will start up with a message asking you to select a workspace. This is where all your work will be saved. If you do not need to change the folder, then click on OK button.
It will display following Java-Eclipse Window.
If you see the window above, then the Eclipse is installed successfully. Now we will test if Eclipse is configured correctly for Java.
In this exercise, we will write a simple Java program to test that the Eclipse installation for Java program.
The first step is to create a new project. Go to File Menu, select New from the drop down and then select the
option Project ….
In the New Project window select Java Project within the Java folder and then click on the Next button.
In the New Java Project window, type the name of your project as Hello World, and click on the Finish button to create the project.
In the Package Explorer panel on the left, you should see the Hello World project folder.
You now have successfully created a project folder for your Java code. Next, we will create a Java file.
Step 3.2: Create Java File
To create a Java Class file, click on File Menu, select option New from the dropdown and then select Class. This will open up the New Java Class window.
In the New Java Class window, type HelloWorld in the Name field and check public static void main(String[] args) under “Which method stubs would you like to create?”
Step 3.3: Write the Code
Now type the following code anywhere between the begin-block ‘{ ‘ and the end-of-block ’}’ for public static void main to make Java code display the message “Hello World!” when you run the program.
Step 3.4: Run the Code
Click on Run menu, from the drop down menu, select the option Run As and then select the option Java Application to compile and test the Java code.
The output widow should display the message “Hello World!” in the console tab.
Congratulations, you’ve successfully installed and configured the Eclipse and Java software on your computer. Now, let’s get ready for developing applications in Java .