Tuesday, July 19, 2011

My First Java Program Using Eclipse IDE

Eclipse is an Integrated Development Environment (IDE) for JAVA.
Download and Install Eclipse IDE. from http://eclipse.org/downloads/ and keep it in separate folder.
Click on eclipse.exe which will ask you the workspace folder, select the default workspace and click on Ok.
 
Creating First JAVA Class
  
From the left pane under Navigator section right click and select New ->  Java Project.
Specify Project Name and click on Finish button, which will creates new folder with settings, bin and src sub folders.
Under src folder create a package on right clicking on src folder and select package.
Specify the name and click on Finish button.
Right click on this package and select New -> Class
Specify some name and click on Finish button.

Copy paste the following code 

package package_name;
 
public class className
{
public static void main(String[] args) {
System.out.println("Hi, This is My First Java Class I have Ever Created");
    }
}

Save the project and right click on it and select Run As Java Application.
 Its done, You can see output under Console as " Hi, This is My First Java Class I have Ever Created. "

Cheers :)