As we all know Windows and Ubuntu are different Operating System. For installing in Windows just we need to click on Eclipse setup package and it will start installation but for Ubuntu it's based on commands.
This post 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 :
1. Create Java Project
Select from the menu File --> New --> Java Project.
Enter "HelloWorld" as the project name. Keep rest of the settings as it is as shown in the following screenshot.
2. Create Java Package
Right click on 'src' folder and select from context menu New --> Package.
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)'.
4. Write Java Code
Edit the generated 'HelloWorld' java class as per the following code.
File: HelloWorld.java
5. Run Your Code
Right click on 'HelloWorld.java' and select from context menu 'Run As' --> 'Java Application'.
6. Console Output
Your code will print 'Hello World' in the eclipse console.
No comments:
Post a Comment