First you need to download Eclipse IDE from
eclipse.org web site. Then you can unzip the downloaded zip file. Then you can run the Eclipse IDE.
Note: Before you run Eclipse, make sure you computer is equipped with Java Run time (JRE). If you don't have JRE installed in the system, you will have to install it before you run the application.
This is Eclipse interface.
You need to create a new project in Eclipse. Use following steps to create a new project.
- Go to File > New > Java Project.
When you create a new Java Project in the workspace, Eclipse creates a special folder to hold all files of the project. Name that you type as the project name will be the name of the project folder. If you have already created a project folder, then you can select
Create project from existing source and the browse for the project folder. If the default
Create new project in workspace is selected, then your project folder will be created in you Eclipse workspace folder.
Next you need to select the Java Run time that you prefer to use to run your Java application.
Click
Next and then
Finish to create a new Java project.
Note : After you clicked the Next button, you should see the following dialog box. In this dialog box you can change the source and output folders. It is good enough to keep the default setting for the moment.
You have just created a Java project. Now you can create a Java class. Use following steps to make a new Java class.
- Go to File > New > Class. This will bring a new dialog box called New Java Class.
- Enter the class name as HelloWorld. This is the name of the Java class that your are creating here.
- Make sure that the public static void main(String [] args) check box is selected. This will add the main method to your class.
Now Eclipse creates a new Java class file called HelloWorld.java. This is created in the
'Your workspace folder'/HelloWorld/src folder. Directory
HelloWorld is project folder that you created before and
src is the default location which stores source codes of your project.
Now you should see the code window appears with some source code in it.
You can enter following code in between opening and closing curly braces.
System.out.print("Hello, World!");
In order to run the program, simply go to Run menu and select Run or click on the Run button on the toolbar.
If there are no errors on the program, you should see the running application on the Console window.