Compiling under the DOS prompt.It has been noted that using the 'edit' text editor is much easier than using 'Notepad' as it doesn't munge the filenames when it saves. You can use 'edit' by opening up a DOS prompt and typing 'edit' at the prompt. You should have already changed directories to the directory for your program. If the file already exists, you can open it directly by typing 'edit myFileName' at the prompt. For example, if you want to edit a file named 'Erik.java' simply type 'edit Erik.java' at the prompt.
Instead of typing in the commands each time to compile and run, I recommend the following. First of all, keep a seperate directory for each program that you build. This will help keep things organized. Then beside the source code for your program you should write two 'Batch' files: 'compile.bat' and 'run.bat'.
A batch file consists of lines that you would type at the prompt. In our case, we only want one line, but it's a long one. Type the command that you use to compile into a file named 'compile.bat'. Then, when you want to compile, instead of typing in that long command again, you can simply type 'compile' at the command line (or double click that file in the Windows95 window which shows it).
The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.