next up previous
Next: Errors, Bugs, and Crashes Up: Guide to CodeWarrior Java Previous: Basic Program Editing

Running Programs

To compile and run your program, select Project|Run (Command-r (Mac) or F5 (Windows)).

If CodeWarrior detects errors in your program, it will display appropriate messages. To get to the trouble spot in the code, double-click an error message.

If no errors are found, CodeWarrior will start the Java Virtual Machine and instruct it to run your program. A console window will appear (this is where text output is written). If your program uses other windows, say for drawing, these will also appear. If they are hidden behind other windows, you can bring them forward by clicking on any visible part of the window or (Windows only) clicking on the window name at the bottom of the screen.

When the last statement in a Java program has been executed, the Java environment continues running to let you examine the program's output and any other program windows remaining on the screen. When you are done, you should quit the Java runtime environment by selecting Apple|Quit (Macintosh; the ``Apple'' menu is the leftmost, apple-shaped menu) or clicking the console window's Close box (Windows).

Remember to quit the Java environment before you select Project|Run in CodeWarrior again, especially if you make changes to your Java program. Otherwise, you may see problematic behavior such as (a) multiple copies of the program running, thus confusing you as to which copy has the changes, (b) running an old version that does not include your changes, or (c) an obscure error mumbling about a ``Link'' or ``Post Linker Error''. Quit the Java environment (not CodeWarrior) and select Run again to run the new version.


next up previous
Next: Errors, Bugs, and Crashes Up: Guide to CodeWarrior Java Previous: Basic Program Editing
CS 100 Course
2000-01-20