Tutorials
In-Depth Walkthroughs
Tutorials
Contributed and maintained by Aramadia Projects
September 2007
See full version with pictures here
This tutorial covers:
Java 6 Update 2 FREE!
Eclipse Editor FREE!
Hello world
This document takes you through the basics of writing your first Java program. No prior experience is required except basic computer literacy.
I’m Lost!
Java is a powerful programming language maintained by Sun Microsystems. A program is simply a set of instructions that allows you to control a computer, and a “language” is the form of communicating your ideas to the computer. There are many languages like C++ and Pascal, in the same way “humans” can communicate in English or French. In order to “write” a program, we need an editor to type the instructions into. While notepad is perfectly capable of writing Java programs, the Eclipse IDE will give you more functionality.
Java and Eclipse are great because they are free. You don’t have to pirate Microsoft Visual Studio .NET 2005 (can make Photoshop CS3 cheap) but rather just download it.
Expected duration: 30 minutes
This tutorial assumes you have some basic knowledge of, or programming experience with, the following technologies.
Nothing!
Before you begin, you need to install the following software on your computer (walkthrough in this tutorial):
Java Standard Development Kit (JDK™) version 1.6.2
Eclipse IDE
<ECLIPSE_HOME> - the Eclipse IDE installation directory
<PROJECT_HOME> - directory that contains the project you create.
Exercise 0: Configuring your Computer
Exercise 1: Installing Java
Exercise 2: Installing Eclipse
Exercise 3: Writing your First Program
Here are the basic pre-requisites your computer should have
High speed internet access
Decent processor (P4 or AMD64 and later)
1GB RAM highly preferred
Windows XP /Linux/ Mac OS(Java is a multiplatform environment, it can be run on any operating system)
Big screen 1280x1024 or better (otherwise it gets cluttered)
Administrator Access!
These aren’t necessary, but highly recommended.
The goal of this exercise is to get Java on your computer. A lot of people get these terms confused:
Java SE, Java EE and Java ME
· Java SE – this is the standard edition: the one you want.
· Java EE – Enterprise Edition. Only required for advanced networking and database stuff. Really boring, don’t bother
· Java ME – Micro Edition. Used to program cell phones and PDAs.
Java JRE versus JDK
· Java JRE –Java Runtime Environment allows you to run Java programs
· Java JDK – Java Development Kit allows you to write and run Java programs. You don’t need to install the JRE if you install the JDK.
Click Download for JDK 6 Update 2
Click on “Accept license agreement”
Check of the appropriate installation. Only select one. For example Windows users should download the offline installation.
Follow the instructions, keep hitting next.
Go to your java installation directory and you should see jdk and jre folders.
Download Eclipse IDE for Java (Click on the appropriate operation system)
Copy your Eclipse zip file to a location of your preference (C:\ is the best because Eclipse tends to make filenames bigger than what your OS can handle)
Extract using your favorite unzipper (I recommend WinRAR)
Designate a workspace. I recommend (\My Documents\Eclipse Workspace)
You should see the welcome screen. Simply go through some of the basics or hit “Go to workbench”. You should see something like this (without anything inside):
Summary
You now have all the tools to do be a real programmer.
I recommend you go through this with someone who already knows how. Programming is a social activity. If you go solo, you can easily get stuck for a week at a time. Ask your friends, senior programmers or go to one of the thousand internet forums. Google is your friend.
Now write this single line of code under the TODO line:
System.out.println(“Hello World”);
Remember to copy each word exactly, even that semicolon. It should look like this:
Go to Run -> Debug or simply hit F11. You should see the program output in the console window.
You are now a programmer. (You achieved Level 1 – fresh meat) There are more then 100 levels.
To send comments and suggestions, get support, and keep informed on the latest developments contact starcraft789@hotmail.com.