Cooking up a programming environment

The ingredients

To follow along with my Karel J Robot programming exercises, you will need four things:

1. Java Standard Edition. Java is a programming language that is made freely available by the Sun Corporation. It’s usually best to get the latest possible version, which at the time of writing is 1.4.2. It can be downloaded from http://java.sun.com/j2se/1.4.2/download.html. Java weighs-in at well over 40 megabytes.

Windows 95

Windows 95 is not supported by Java version 1.4.2, so if that’s your platform you’ll need to grab an earlier version from http://java.sun.com/.

2. BlueJ. BlueJ is a programming editor orginally developed at Monash University (although it now appears to have gone over to Deakin) to help people learn to program. It can be downloaded from http://www.bluej.org/download/download.html and it can also be found on the monthly CD-ROM.

3. Karel J Robot. Karel J Robot is the robot simulator that we will be programming. It can be downloaded from http://csis.pace.edu/~bergin/KarelJava2ed/karelexperimental.html.

4. Examples. The zip file containing the examples from the article is available from this website.

The method

Add your ingredients in order. First install Java by running j2sdk-1_4_2_01-windows-i586.exe. (Extra installation instructions are available from the Sun web site if necessary.) Take note of where you choose to install the program (maybe C:\j2se1.4.2) - remember this and we’ll refer to it as the Java Folder.

Next install BlueJ - run bluejsetup-130.exe. (Extra installation instructions are available from the BlueJ web site if needed.) The installer will ask where you want BlueJ to reside (maybe C:\bluej) - make a note again, and we’ll call this the BlueJ Folder. The installer may also ask for the name of your Java folder.

Unzip karelpremier.zip into a folder that we’ll call (with breathtaking originality) the Karel Folder.

Finally unzip karel-example01.zip into a folder that we’ll call the Working Folder.

Now start up BlueJ and you will be presented with the BlueJ Project Window:

The BlueJ Project Window

Figure 1

Celebrate - it works! On the menu choose Tools- Preferences, then choose the Libraries tab in the Preferences window. Click Add, navigate to the Karel Folder and select the file KarelJRobot.jar. Your entry should show up like this:

The BlueJ Preferences Window

Figure 2

You will now need to exit and restart BlueJ and you are ready to start.