GETTING STARTED WITH JAVA (DOS)

Mtht 420

This is the DOS version (for public labs and home computers with Sun's JDK installed) of these instructions.


Before sitting down to type in, compile, and test a program you should have:

  1. A written copy of the program you wish to type in,
  2. Your netid and password (usually the same as your account on icarus), and
  3. A blank or DOS/IBM formatted floppy diskette.
The Sun JDK (Java Developer's Kit) should be installed in computer labs in:

SEL 2249, ECSW L270, BGRC 179, SSB 2300

it may also exist in other labs. When you are ready to enter your program into the computer, go to one of these labs and do the following:

  1. Log on to the machine using your netid and password.
  2. Insert your diskette in the drive. Format it if necessary.
  3. Choose "MS-DOS Prompt" from the Start menu in the lower left hand corner of your screen. This will create the window on your screen in which you will work.
  4. Type A:\ so that files you create will be saved on your diskette. If you do not do this, your files will probably be deleted as soon as you leave the computer.
  5. Type edit Welcome.java to create a file named Welcome.java containing your code. Type in your program or applet -- the sample applet in section 1.16 of Deitel and Deitel is a good applet to start with. (There are many ways to create and edit a file. If you prefer another editor which can create compilable plain text files, feel free to use it. Be warned that you may not be able to get help in class if it fails to work.) Save your work and quit the editor when you are done.
  6. Type C:\jdk1.1.7A\bin\javac Welcome.java to compile your program or applet. If the compilation is successful (no error messages), typing DIR A:\ should show you two files: Welcome.java and Welcome.class.
  7. At this point, you have typed in some Java code and compiled it. The next step is to try running it. Running a Java program is different from running an applet.
  8. Test your applet or program to see if it does what you want it to do. Edit your code (edit Welcome.java), save, compile, and run (you do not need to create a new html file unless you change the name of your program) until it does what it's supposed to.
  9. Back up your work by emailing copies to yourself, copying it to icarus via ftp, printing it out, or saving it to another diskette.
  10. Double click on the Logout (stop sign) icon, eject your disk from the drive, and give the next lucky student a chance to log on!


Mtht 420