cef - /* The progrem "cef" is meant to solve a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* The progrem "cef" is meant to solve a problem with compiling a program in a DOS window under Windows 95 or 98: If the compilation produces more than a few error messages, the first messages will scroll off the screen. In UNIX and in Windows NT, there is a way to send the error messages to a file, which you can then view at your leisure. The cef program does something similar. "cef" stands for "Compile and send Errors to a File". (Of course, this program will also work under UNIX or Windows NT, though it isn't necessary there.) You will have to start by compiling cef itself, using the command "javac cef.java". (There will be a warning about using a deprecated method, but this is not an error.) The compiler will produce a class file, cef.class. In order to use cef, you should copy the class file, cef.class, into the directory where you want to use it. That is, copy it into the directory that contains the java source code file that you want to compile. Then, to use cef, run it using the "java" command. You can give the name of the Java source code file, or files, as command line parameters. For example, if you want to compile a file named "MyFile.java", say: java cef MyFile.java Alternatively, you can just say java cef and you will be prompted to enter the name of the file. The file will be compiled as usual, as if you had said "javac MyFile.java". However, error messages will be put in a file named "errors.txt". You can view this file, for example, by giving the command: notepad errors.txt If the Java file does not contain any errors, then a message will be output to the screen saying "Compilation finished with no errors." In this case, the file errors.txt will just contain the message "No errors". Please note that if there is an existing file named errors.txt, it will be overwritten. It is possible to specify a different output file for the error messages. To do this, use the option "-f <filename>" on the "java cef" command. For example, to send the error messages to a file named "messages.dat":
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2010 for the course CSC 115 taught by Professor Jackson during the Spring '09 term at University of Victoria.

Page1 / 5

cef - /* The progrem &quot;cef&quot; is meant to solve a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online