What’s needed to be prepared for learning Java programming?

When you decided to start to learn Java Programming you can start by downloading the Java Development Kit (JDK) from Java Download website. There are three different types of JDK, the Java SE (Java Standard Edition), Java EE (Java Enterprise Edition), Java ME (Java Mobile Edition).

From the website you can also download the Java API documentations which will sure be your first companion when learning the language. It is better also to download the Java Tutorial Series that was written by the Java experts.

In the tutorial you can learn from the basic of Java programming, introduction of the fundamental of Object Oriented Programming (OOP) which is Java all about. Next you can also find trails in each subject of the API (Application Programming Interface) provided by Java library, such as the core package, how to communicate with database, Java GUI programming, image manipulation, RMI, Java Beans Framework, etc.

When you want to write a code you might wonder what editor or IDE you will need to use to start learning. A good text editor that support a coloring will be a good candidate, colorful screen is better that just black and white isn’t it?

There are a lot of good text editor available today such as the VIM, NotePad++, TextPad, Editplus, UltraEdit. If you already have your preferred editor you can use it of course.

If you’re ready for the big stuff, a bigger homework project, you might considering to use an IDE (Integrated Development Environment) as you’ll be working with lots of Java classes, configuration files and build script for examples. There are many great IDE on the Java world from the free to the commercial product.

What IDE to use is really a developer decision, use whatever tools that can help you to improve your learning and programming activities. You can find IDE such as NetBeans, Eclipse, JCreator, IntelliJ IDEA, JDeveloper, etc.

Beside learning from the Java tutorials there are also many forum on the internet where you can discuss your doubts or your problems. Forums like JavaRanch, Stack Overflow are great forums with Java gurus that can help you to clarify your doubts and help you to solve your problem. But remember one thing when you ask for help, be polite, elaborate your problem clearly.

A good Java books on your desktop is also a good resource to study Java, from a good books you can learn the bolts and nuts of the Java programming languages. When you have all your arsenal you can get the best out of you in learning Java. Have fun!

How do I write Hello World program in Java?

Hello World is a classic program example to start with when we begin to learn a new programming language. The main purpose is to know the basic syntax of the language. Below is the Java version of a Hello World program, it simple enough to start.

package org.kodejava.example.basic;

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");

The code contains one class called HelloWorld, we declare a class using the class keyword. A main(String[] args) method with a public static void signature and an argument of string array is a special method in Java class. This method is the execution entry point of every Java application. When a class have this method it will be executable. And finally in the body of the method we have a single line of code that write a Hello World string to the console.

The HelloWorld class must be saved in a file named HelloWorld.java, the class file name is case sensitive. In the example we also define a package name for the class. In this case the HelloWorld.java must be placed in a org.kodejava.example.basic directory.

To run the application we need to compile it first. I assume that you have your Java in your path. To compile it type:

javac -cp . org.kodejava.example.basic.HelloWorld.java

The compilation process will result a file called HelloWorld.class, this is the binary version of our program. As you can see that the file ends with .class extension because Java is everything about class. To run it type the command bellow, class name is written without it extension.

java -cp . org.kodejava.example.basic.HelloWorld

And you will see a string Hello World! is printed out in the console as the output of your first Java program, the HelloWorld program.

To install Java Development Kit (JDK) and configure Java environment you can see the following tutorial: