This article describes how to create a "Hello World" java program using Eclipse IDE. This program will print "Hello World" in the console.
Technologies used in this article :
- JDK 1.6 +
- Eclipse 3.7
1. Create Java Project
Select from the menu File --> New --> Java Project.
Click "Finish" button and Eclipse IDE will generate the java project automatically.
2. Create Java Package
Right click on 'src' folder and select from context menu New --> Package.
Write 'com.hello.example' in the 'Name' field and click "Finish" button.
3. Create Java Class
Right click on 'com.srccodes.example' package and select from context menu New --> Class.
Write "HelloWorld" in the 'Name' field and select the check-box for 'public static void main(String[] args)'.
Click "Finish" button. Eclipse will generate a java class and open the same in the java editor as shown below.
4. Write Java Code
Edit the generated 'HelloWord' java class as per the following code.
File : HelloWorld.java
package
com.srccodes.example;
public
class
HelloWorld {
/**
* @param args
*/
public
static
void
main(String[] args) {
System.out.println(
"Hello World"
);
}
}
Comments
Post a Comment