Are you an aspiring JAVA programmer? Cool. Let’s try this.

Old 2 Comments on Are you an aspiring JAVA programmer? Cool. Let’s try this. 18

I know some folks are wannabes for Java programming. Well, have you ever written any Java program? NO? OK. Just follow the instructions below.

The Problem

Let’s write a simple Java program that says “Hello World!” It seems trivial but getting a computer to do this is a milestone in programming. This is probably the routine you’ll be following to create, run or test all of your Java programs.

Getting the tools

  1. Download JAVA JDK (Java Development Kit) for your respective platform; windows, linux and mac at: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Install JAVA JDK
  3. Download eclipse Eclipse IDE for Java Developers for your respective platform; window, linux and mact at: http://eclipse.org/downloads/packages/eclipse-ide-java-developers/keplersr2
  4. Extract eclipse IDE (IDE = Integrated Development Environment) to a folder
  5. Restart your computer
  6. Now start eclipse IDE

Creating Java Project

  1. Click “x” Right above the word “Welcome!”
  2. Click File then New, then Java Project
  3. Fill in the Project name as “Hello World”

Creating Java Class

  1. Right click the project name, in this case Hello World
  2. Point to New then Class
  3. Fill in the name as “HelloWorld” (Don’t Space!)
  4. Click finish

Working on the code

After creating a Java Class, a window with some kind of code pops up in the middle of Eclipse IDE

Delete everything and copy and paste the following code in green:

// The “//” means we are commenting
public class HelloWorld {

public static void main (String []args){

System.out.println(“Hello World!”); // Prints the message Hello World! on Standard output

} // end of main routine

} // end of class “HelloWorld”

Running the Application

  1. Right Click on the project (In this case Hello World)
  2. Point to Run As
  3. Then Click Java Application

Final Notes

Look somewhere below the eclipse window and you’ll see the message “Hello World!”

Now go learn more about Java!

 

Author

William Oneb

William Oneb is Java Programmer, Android Developer, Web Designer and is currently studying Objective C. He has developed at least 3 wordpress plugins/widgets. He is interested in iOS development too.

Related Articles

2 Comments

  1. ebey June 27, 2014 at 12:53 pm

    Cud u give some tips on creating android apps using java

  2. augustine March 24, 2015 at 10:06 am

    yeah could you

Leave a comment

Back to Top