Installing Java and BlueJ
Last Revision: February, 2002
( McCann )
Looking to install Sun's Java 2 SDK, Monash University's BlueJ Java
development environment, and the javabook package for Wu's Java text?
Reading this first couldn't hurt much, and might even help you out.
First, the caveats:
- I used Windows XP Professional for the installation. If you are using
a different version of Windows, these instructions will most likely
have to be modified for your system.
- I didn't just dream up these instructions; they really worked for me.
If they don't work for you, I'm sorry, but I probably can't help you
much. If you lose some files,
I'm not to blame. If your computer explodes spectacularly, I hope
you take pictures, 'cause I'll want to see them.
Step 1: Download these files:
- The Java 2 SDK for Windows from
java.sun.com
(j2sdk-1_3_1_02-win.exe is 44,495,461 bytes in size, or roughly
half the size of a typical computer game demo these days)
- BlueJ from www.bluej.org
(bluej-115.jar is 694,700 bytes in size)
- The SWING version of the javabook package from
www.drcaffeine.com
(swing_javabook_pkg.zip is 64,725 bytes in size)
Obviously, The SDK is going to take a long, long time to download if you're
like most people and have a net connection through a modem. Plan ahead, or
find a friend with a broadband connection who can download it to a CD-RW,
CD-R, or Zip disk for you.
Before we move on, here is a list of links to pages with downloading and
installation information for these software packages. If you run into
trouble, start looking for answers here:
- For the Java 2 SDK:
- For BlueJ:
- For javabook:
Step 2: Install the Java 2 SDK
From within Windows Explorer, double-click on the SDK file you downloaded.
(The name will probably be something like j2sdk-1_3_1_02-win.exe)
It will unpack a bunch of stuff, and then you'll see the first of several
installation windows. Here is the list of the ones I saw, and what I
did in each:
- Welcome: It recommends closing your other windows, so I
closed all of them except Windows Explorer. I've successfully
installed previous versions with many windows still open. Click Next
to continue.
- Software License Agreement: I clicked Yes without reading a word
of it.
- Choose Destination Location: I have a directory on my C drive
named langs, into which I install all of the programming
language-related software I install. So, I set the Destination
Location to be c:\langs\jdk1.3.1_02 and clicked Next.
- Select Browsers: I was a bit peeved that there was no automatic
installation option for browsers other than Internet Explorer or
Netscape 6.*. Still, this is progress; previous installers didn't even
offer this window. I just clicked Next. If you use a different
browser, you'll have to check
http://java.sun.com/ or your
browser's installation instructions to see how to install a Java
plug-in so that you can execute Java applets with your browser. Note
that this isn't necessary to run your own applets; you can use BlueJ
to run them, or the appletviewer that comes with the Java 2 SDK.
- Select Components: I clicked Next, to accept the default
(which is to install everything).
And then it installs the SDK. Assuming that everything
went OK, you'll next see ...
- Setup Complete: I clicked 'Yes, I want to view the README
file.', and clicked Finish.
I read the README file (it didn't say much, frankly), and closed
the Notepad window.
IF YOU HAVE PROBLEMS: Visit those links I listed in Step 1, above.
Step 3: Install BlueJ
I just double-clicked on the bluej-115.jar file (in Windows Explorer,
of course), and saw a window titled:
- BlueJ Installation: I set the 'Directory to install to:' box
to read c:\langs and the 'Java (JDK) directory:' box to
c:\langs\jdk1.3.1_02 and clicked Install.
The installation went smoothly.
Step 4: Test the installation of the SDK and of BlueJ.
In c:\langs\bluej, I found a file named bluej.bat
In Windows Explorer, I double-clicked it, and BlueJ fired right up.
I tested it by loading one of the
example programs from the BlueJ examples directory.
It compiled and ran just fine.
A note for Windows 95/98/ME users: The last time I tried to install
and run BlueJ was under WinME, and when I first tried to run it I
got a DOS screen titled 'Finished - bluej' with the message 'Out
of environment space' twice, and a thread exception message.
I went to Google and searched for that error message. The
first hit was to Microsoft's support site with a link for Windows ME
(how convenient!):
http://support.microsoft.com/support/kb/articles/Q261/8/25.ASP
(A similar page for Win 95/98 users is:
http://support.microsoft.com/support/kb/articles/Q230/2/05.ASP)
I chose Method 1 to solve the problem. I opened a DOS
window (Start --> Programs -> Accessories -> MS-DOS Prompt
under Windows ME), and upped the initial environment size to
the maximum (4096 bytes). I clicked Apply, got the 'hey, you
need to restart the program' message, closed the DOS window,
and opened another DOS window. I changed to
the BlueJ directory and typed 'bluej'.
It fired right up.
Step 5: Install the javabook package.
In Windows XP (and ME, for that matter), ZIP files can be extracted
without a separate
unzip program. I right-clicked on the swing_javabook_pkg.zip file
and told Windows to extract the contents (a folder and a .GIF file) to
c:\langs.
A brief historical message: Originally, the package of extra classes for
Wu's book was named javabook. Then a new version of the package
was created, and to distinguish it from the first one it was named
javabook2.
Recently, the new version was apparently renamed to be just plain 'javabook',
probably to match the
text. Unfortunately, we have the lab and our class materials set up to use
'javabook2'. So, when you develop programs with this installation you're in
the process of creating, use import javabook.*; in your programs.
When you're working in the lab, use import javabook2.*; instead.
Definitely an annoyance, but a minor one.
The page
http://www.bluej.org/help/archive.html#tip5
explains how to tell BlueJ how to find classes like javabook.
You can find Preferences under Tools in BlueJ 1.1.5.
I used the 'Add' button in the Libraries tab
in the BlueJ Preferences window to add
c:\langs to the User Libraries list, and after
restarting BlueJ I could use import javabook.*; just fine.
NOTE: If you have trouble with that approach, you can leave the
swing_javabook_pkg.zip file as-is and just add the name of the
zip file to the User Libraries list. While this is easier, I think I would
recommend that you try the first approach; people tend to remove or move
zip files without thinking (they're meant to be for storage and transfer
of files, after all), and so after a hard drive cleanup you may
discover that you inadvertently (re)moved this one, too. But, use
whichever works for you.
And that's all I did to install those three packages. Good luck!
Do you have a comment on this page? I'd like to hear it; you can email me at
mccannl@acm.org.