TA Corner

Help on the Lab programs

  1. Writing a program in Java    General hints and helps
  2. Additional batch files          You may find these useful
  3. Turbo-charge your turnaround using batch files
  4. Trouble finding class files
  5. CS-10 BlogSpot http://cs10w07.blogspot.com/
  6. Wheels Crib Sheet

Writing the Program

The base system for writing Java programs is the SDK (Systems Development Kit) from Sun. 

To enter text you can use any of several programs:
Program Commets
notepad This program is supplied with windows. It is about as simple an editor as you can get.  The main advantage is speed.
wordpad Similar to notepad but will handle larger files and save to the Word document format
edit An editor that runs under under DOS.  Basically a keyboard-oriented editor it has rudimentary mouse support. Tells you the line number in the program
Word The main Windows text editor.  Really oriented for word processing but can be used if you are very careful to save in the text (txt) format.  Not recommended.

 

3. Turbo-charge your turnaround using batch files
You can reduce the time it takes to edit-compile-run by using batch files. Batch files are simply text files that supply keyboard input. 

Assuming you are using dos edit and re working on the program FirstApp.java, you could use the following batch file:
        edit FirstApp.java
        javac FirstApp.java
        java FirstApp

Save the batch file as something like f.bat. Then when you type f the editor comes up ready to edit you code. After you close the editor the compiler is called followed by the run-time package. If you are using a different editor, say notepad, you would change the first line to something like
       notepad FirstApp.java

4. Trouble finding class files
If your compiler has trouble locating class files, add the following line to your set up batch file:

set CLASSPATH = c:\Java


 Where c:\Java is your Java program development area.

Wheels Sheet

This sheet is a summary of the wheels classes and methods.

Wheels Crib Sheet