Installing Java on your home computer.

We will be using version 1.1 of the Java programming language for this course. This page tells you how to install this programming language on your home computer. There are roughly two major steps in this installation. The first major step is installing the Java language itself on the computer and the second major step is installing a text editor that makes it easier to use the Java programming language. The first step is absolutely essential if you want to do you Java programming at home. The second step is not essential, it is really just to make your life easier while you are writing Java programs. Steps 1 and 2 below install Java on your computer and steps 3, 4, and 5 install the editor. Step 6 below is an important step. In that step you will try out your Java installations to see if it works.

Step 1:
Download Sun's JDK 1.1 installer program using the link at the end of this paragraph. Be sure to pay attention to where you tell your browser to store the installer. The JDK 1.1 installer is a little over 8 MB in size, so expect the download to take over an hour using a modem. After the installer program is finished being downloaded, you install Java on your computer by just double clicking on the installer program that you just downloaded and following the instructions in the installer program. It is best if you do not make any changes in any of the options the installer program presents you with; always choose the default option.
Sun's Java Development Kit 1.1.8 for MS Windows

Step 1.5 (Optional):
If you want to, you can test your JDK installation. Use the Start Menu to start up a "MS-DOS Prompt" window. At the DOS prompt, enter the following command.
C:\jdk1.1.8\bin\javac
You should get a "usage message" back from the Java compiler.

Step 2:
You need to modify the autoexec.bat file on your C:\ drive. (If you do not have an autoexec.bat file on your C:\ drive, then you need to created one using the Notepad text editor.) Find the autoexec.bat file on your C:\ drive. Right click on this file using your mouse and choose the Edit option from the pop up menu. Move down to the end of the contents of autoexec.bat and add the following line to the file
set path=%path%;C:\jdk1.1.8\bin;
Be sure to enter this line into the file exactly as it is typed here (you can even use cut and paste to move the line from this web page to the autoexec.bat file). After you have added this line the file, choose Save from the File menu, then choose Exit from the File menu. Now you must restart your computer for this change in the autoexec.bat file to take effect.

Step 2.5 (Optional):
If you want to, you can test the change that you made to the autoexec.bat file (after you have restarted your computer). Use the Start Menu to once again start up a "MS-DOS Prompt" window. At the DOS prompt, enter the following command.
javac
You should once again get a "usage message" back from the Java compiler (if you don't, then you probably did not set your PATH variable properly in the last step). Notice how it is now much easier to use the Java compiler. In Step 1.5 we had to use a "full path name" for the compiler, but in this step we only need to use the compiler name itself, javac.

Step 3:
Download the TextPad Version 4.5 text editor. TextPad is shareware; you can download and use it for free for a trial period, but then you are supposed to pay a shareware fee if you plan to continue using it. Use the following link to download the installation file (which is just over 2.5MB in size).
ftp://download.textpad.com/pub/textpad4.5/txpeng450.exe

Step 4:
Install TextPad by double clicking on the installer that you just downloaded.

Step 5:
Run TextPad by finding it in your Start Menu. Click on the Tools menu at the top of the TextPad window; you should see three commands for using Java at the bottom of the list, one command for compiling Java programs, one for running Java applications and one for running Java applets.

Step 6:
Now it is time to test TextPad and Java. It would help at this point if you would read Sections 2.1 and 2.2 of our Java textbook. Use your browser to download and save this very short Java program, JavaRules.java, to your computer. Use TextPad to open JavaRules.java (use the "File -> Open" menu item in TextPad; you will need to remember where you had your browser store the JavaRules.java file). Use the "Tools -> Compile Java" menu item to have TextPad run the Java compiler. Now use the Tools -> Run Java Application menu item to have TextPad run your program. Now deliberately put a mistake into your Java program by deleting a semicolon. Compile the program again to see what happens. Double click on the line number in the compiler's error message to have TextPad jump to the offending line.

Step 7 (Optional):
If you do not have the program WinZip already installed on your home computer, then you should install it. Click on the following link to download the Windows version from the WinZip Download Page (the download should begin automatically). Follow the instructions on that page to install WinZip. (This step is needed for the following two optional steps.)

Step 8 (Optional):
After you get past the really basic parts of learning Java, it helps to learn how to use Java's documentation. So now we will install an easy to use version of the Java documentation. Open your C:\jdk1.1.8\ directory and create a subdirectory called docs-win. Download the Windows Help File version of the Java 1.1 documentation using the link at the end of this paragraph. After you have downloaded the zipped up help file, use WinZip to unzip it into the C:\jdk1.1.8\docs-win\ directory that you just created.
JDK 1.1.8 Documentation in Microsoft Windows Help Format

Step 9 (Optional):
Now we need to create a tool in TextPad to use the help file we just installed. Start TextPad and go to TextPad's Configure menu and click on Configure -> Preferences... menu item, then click on "Tools" (not the little + sign next to "Tools"), then click on Add and then select "Online Help File..." from the drop down menu. Use the dialogue box to navigate to the C:\jdk1.1.8\docs-win\ directory, select the file jdk118.hlp, click the "Open" button, click the "OK" button. Now look at the bottom of your list of TextPad tools, there should be one called Jdk118. Open a Java source file with TextPad, select the word class, and then click on the Jdk118 tool. This should bring up a help window.

TextPad is a very powerful text editor. It has a lot of tools that make working with Java and HTML files much easier. Editors like Notepad or DOS's Edit really pale in comparison to an editor like TextPad.

When you are editing your Java source files with any editor, remember to save your work frequently (at least every 15 minutes), otherwise it may be Abort, Retry, Ignore?


Return to the main Java page.
Return to the CS 490A home page.


compliments and criticisms