This tutorial makes a few assumptions. We’ve assumed that you’ve installed the JDK and have it running. For this tutorial I’m using Ubuntu Linux at the command line, but the code is the same if you’re using Windows.

Step 1: Create File

Create a file called “HelloWorld.java”. In there type the following code:

This code is pretty self explanatory. We’re creating a class called “HelloWorld”. When that class executes the first thing that runs is the main() method. Within that method we have a System.out.println method that outputs text.

Step 2: compile

To compile this, we simply type:

1

javac HelloWorld.java

This compiles into a file named HelloWorld.class

Step 3: Run

To run this file, we type in:

1

java HelloWorld

And it outputs text. It’s that easy!

Now find some ways to make text output interesting. There are thousands of cool things you can do at the console.