Java - Hello World!

Introduction: Java - Hello World!

The first step in learning any programming language is to have it print out "Hello World!" This instructable will take you through all the necessary steps to print out hello world in java.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Download Java

Download Java from Java's official website.

Step 2: Choosing an IDE

To program Java all you really need is a simple text editor such as notepad, but nobody wants to torture themselves like that. There are various Integrated development environments (IDE) that can be used to program java that offer many features such as automatic compiling and error recognition. Pictured above is Intellij by jet brains. It is considered to be the best Java IDE, but it is expensive. For this instructable I will be using Eclipse which is a free alternative.

Step 3: Create New Project

Click on the create new project button and select new java project. You can input the version of java that you want. I am using java version 1.8. Name the project whatever you want. I named mine Hello World. When you're satisfied with the options create the new project.

Step 4: Create New Class

All code in java is written in a class. Create on by clicking on the create class button in the top row. Be sure to check the public static void main option. If you don't its not a big deal. just copy the function below inside the class curly brackets.

public static void main(String[] args) {
// TODO Auto-generated method stub

}

Step 5: Type Code

Inside the public static void main function type

System.out.println("Hello World!");

You can put anything you want in the quotation marks. To run the code click on the play button in the top row next to the other options.

Be the First to Share

    Recommendations

    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020

    Discussions