Google

Lesson One

Getting Started


First thing's first, you need what is called a Java Systems Development Kit (SDK). You can find many different SDK's on the net, but the one that you should use is any of the SDK's from Sun. If you would like to view more Java programs, applets, etc., feel free to visit FreewareJava.com. If learning Java doesn't interest you, maybe you should try The JavaScript Tutorial.

After you've installed the program, you have two options, go to www.cnet.com > Developer Tools > Tools and Editors and download TextPad to easily create your programs without anything more to do. Here, you can create, save, and compile all of your programs without configuring your computer. You can also take the hard way and find and open your MS-DOS prompt to set the program to your computer. You should be able to find it by clicking "Start", then go to "Programs", and finally scroll down until you find "MS-DOS Prompt", or click "Start", then go to "Accessories" and scroll down until you find "MS-DOS Prompt". You can also click "Start", then click "Run", then type "command" in the search box. Then type path = c:\sdk1.4.2\bin to let your computer know that this is where you are going to be working from. If your DOS has anything more than C:\> (like: C:\WINDOWS\DESKTOP\>), type cd.. to change the directory to your root directory (C:\>). This is what you need to do EVERYTIME you want to work with Java (NOTE: If you have a text editor that allows you to compile Java, you may omit this step). If you have a special folder that you want to save your work in (i.e. a folder called Java), you need to type cd Java to compile and run your programs. Otherwise, you'll receive the error message can't find program "" 1 error.

Now that the hard part is out of the way, let's start working. Open up Notepad (or your text editor) and type the text you see below:

public class First
{
public static void main(String[] args)
{
System.out.println("This is my first Java Program!!!");
}
}

Now, go click File, click Save as, type "First.java" (or just First if you're using TextPad) in the File name: box, and make sure it says Text Documents (or *.java in TextPad) in the Save as type: box. Also, make sure you are saving it to the right place (or folder). Here's the moment you've been waiting for: switch to your DOS prompt and type javac First.java (or go to Tools > Compile Java in TextPad). If just your prompt comes up, it compiled. If not, and you get an error message, check to see if you did everything correctly. Then, type java First (Tools > Run Java Application in TextPad). You should get the message: This is my first Java Program!!! If you have any other problems, click here and leave a message in our "forum".

Question: That's Java?? I thought it was more than that. Isn't there other things I can do?

Answer: Yes, and I will teach them to you. But in order to know Java, you have to know how Java works. Patients will teach you everything!


Home | Lesson Two

If you have a questions about any of the lessons, feel free to ask.

We get our music from
1