Development using Two Windows
An alternative to just using commands is to use two windows. This involves
having an editor window and a compiler window, and switching between them. In
one window, your favourite editor is running, with the program permanently
loaded into it. The other window is a shell window in which you issue the
javac and java (and possibly jdb) commands.
In Unix, to get an editor window to run permanently, use an &
character at the end of the line:
> jedit Prog.java & ( run editor in separate window )
> javac Prog.java ( use the shell for compiling/running )
...
The development cycle is:
- make changes to the program in the editor window
- use file:save or whatever in the editor window to write the
changes to the file
- use the javac command in the shell to recompile the program
- if there are no compile errors, use java (or jdb) to
test the program
- repeat
The main features of this approach are:
- + It is relatively simple
- + It works with most platforms and all languages
- + You can stick to your favourite editor
- + It can be very efficient because it gets rid of the overhead of
repeatedly starting up the editor
- -- There can be delays in repeatedly running the compiler
- -- You can get very confused if you forget to save the file in the
editor, or forget to recompile the program in the shell.