le sidebar
back to...
 main
section 1: preparations

Back | Skip forward

why do I need preparation?

My philosophy is that programming is as much an art as a science. (I like to think that that's why they changed the name of the course from "Computer Science" to "Computing". Of course, it's not.) Just as the painter needs brush and palette, and the sculptor needs hammer and chisel, the programmer needs a unique set of tools. Obtaining these tools and being ready to use them is the first step.

Note: if you get lost anywhere in this tutorial, please e-mail me. I'd like to make this as user-friendly as possible.

so what are these tools?

The most basic tools you ABSOLUTELY must have are a Java compiler/interpreter and a text editor. Fortunately, if you're in SoC, you can access these tools easily, as they are available on the School's UNIX systems. If you don't have a UNIX account yet or are not sure how to use it, you can always try this out on your home computer - but you'll have to download the tools first.

Some people recommend you use a commercial Java development suite like Symantec Visual Cafe or Microsoft Visual J++. I absolutely disagree with this. Firstly, the versions of Java used in these products are often outdated. Secondly, they cost a LOT of money, unless you get pirated versions which are (obviously) illegal. Third, they don't provide that much functionality over and above what you can get with a "homebuilt" toolkit; a novice user will need plenty of time to learn how to use the extra features and an experienced user won't need them most of the time. Fourth, programs created with Microsoft's so-called Java products run a high risk of being incompatible with the vast majority of Java platforms, as they use unauthorized extensions.

So what should you use for programming in Java - assuming you're working with a PC running Windows 95/98/NT? Well, Sun Microsystems has kindly provided the world with the Java Development Kit, which is THE definitive Java compiler. Many commercial Java tools are actually built around the JDK, which is why I made the comments I did. I'll upload the JDK to my website sometime (when I manage to free up enough disk space), but for now you can download it at java.sun.com. I'll get to how to actually use it soon. (Promise.)

As for a text editor, you probably already have a text editor on your system in the form of Windows Notepad. However, I strongly recommend you do not use Notepad - it doesn't have enough functionality to make it useful for writing Java. Instead, download EditPad, a much better replacement. It's only a few hundred kilobytes in size , and worth every one of them.

alright, I've got hold of the stuff - now how do I use it?

The first thing to do, naturally, is to install it. The JDK comes as a self-installing package, so you can just double-click on it in Windows Explorer to install it. NOTE: when you install the JDK, make sure you can find the folder/directory where you installed it! This will be important later.

EditPad's a little trickier. You'll have to have WinZip (most people have this, but if you don't you can download it from www.winzip.com) installed. Extract the appropriate files into a directory - for example, C:\Program Files\EditPad. What you'll want to do now is to create a shortcut on your desktop and/or Start menu to start EditPad. If you already know how to do this (don't laugh, some people don't!), you can skip the next paragraph. If not, read on.
CREATING A SHORTCUT:
Using Windows Explorer, open the folder to which you installed EditPad. Right-click on EditPad.exe and choose "Copy". Now close or minimize (shrink) Windows Explorer. Right-click on your desktop and choose "Paste Shortcut", and a shortcut will appear on your desktop bearing the EditPad icon. Double-click on it to open EditPad.

don't panic - we're nearly done with preparations...
Two more very short steps to go. First, you'll have to configure Windows to automatically open Java files in EditPad. Second, you'll have to set your system's auto-pathing feature to search for the Java compiler. Don't worry if the latter sounds like gobbledegook - it'll all become clear soon.

To configure Windows:
Open Windows Explorer. Click View (from the menu bar), then Options. Click the File Types tab, and then click the New Type button. Now enter the following information:

Description of type: Java Source Code
Associated extension: .java (don't forget that dot!)

Now click "New..." and enter the following:
Action: Open
Application used to perform action: (insert the location of EditPad.exe here. For example, if you installed it to C:\Program Files\EditPad, enter C:\Program Files\EditPad\EditPad.exe)
Now just click OK, then OK, then Close to close all those dialog boxes you opened.

To set the auto-pathing:
In Windows Explorer, go to drive C:. Right-click on autoexec.bat and choose "Copy". Then right-click anywhere else in the window and choose "Paste". This is so you'll have a backup in case something goes wrong. Now right-click on autoexec.bat and choose "Edit".
Notepad will open. Find the line that begins with "PATH" - it should look something like "PATH = c:\WINDOWS;C:\WINDOWS\COMMAND". Add the following at the end of the line:
; (insert your JDK directory here)\BIN
For example, if you installed the JDK to C:\JDK1.1.7B and your PATH line read:
PATH = C:\WINDOWS;C:\WINDOWS\COMMAND;C:\WINDOWS\SYSTEM
then it should now read:
PATH = C:\WINDOWS;C:\WINDOWS\COMMAND;C:\WINDOWS\SYSTEM;C:\JDK1.1.7B\BIN

Got that? Now save the file, close all programs and restart your computer. Once it's done booting up, proceed to the next section.


Back | Forward