1. Technology

Lesson 1 - Getting Started

By

Man on a computer at a desk
Chris Ryan/OJO Images/Getty Images

Note:The beginner's corner lessons provide a structured tour of the content found on this Java site. Follow the links contained within the lesson to learn about programming with Java.

The aim of this lesson is to set up a Java programming environment on your computer before heading straight into the action by writing a simple Java program. It ends with a quick overview of spotting compile-time errors using NetBeans.

The JDK

Java, like most areas in the computing world, has its fair share of acronyms. You might hear the terms JRE (Java Runtime Environment) and JDK (Java Development Kit) used frequently in Java discussions. The key difference between the two is the JRE enables a computer to run Java programs and the JDK enables programmers to writer and compile Java programs.

Tip: The JDK also contains the JRE. If it didn't you wouldn't be able to run the Java programs you write!

As our goal is to write Java programs, the first task is to download and install JDK 6 on to your computer. Note: If you are using a Mac you should already have a version of JDK 6 installed.

The Java Editor

Java programs are written as plain text. There is nothing fancy about the contents of a Java file itself, its power comes from the translation of the text into a Java program. Therefore, we could write Java programs in any program that lets us create files in plain text and it should come as no surprise that the number of editors available to Java programmers is numerous.

Whether a beginner uses an IDE or a text editor is ultimately a personal choice but I'm going to suggest using NetBeans. Follow the steps in getting started with NetBeans to download, install and write a very Java simple program.

Dealing With Errors

Unfortunately, every Java programmer is going to come across their fair share of errors. Learning how to find and fix them is known as debugging. It’s not always a fun task but NetBeans can help make it easier. In fact, even as you type Java code into the editor it looks for errors that will stop your program from compiling. Try it out in simple debugging with NetBeans.

Errors You Might Encounter

Listed below are some common errors you might come across while working through this lesson. If so, click on the links to find out the cause and possible solutions:
Cannot Find Symbol
Reached End of File While Parsing

  1. About.com
  2. Technology
  3. Java
  4. Getting Started
  5. Beginner's Corner
  6. Beginner's Corner Lesson 1 - Getting Started

©2014 About.com. All rights reserved.