Java Outside In - Development Environments

Java Outside In - Development Environments

In Chapter 1 of the text we discussed the life cycle of a computer program:

  1. Imagine what the program will do
  2. Design it
  3. Write the program in some language (Java, of course)
  4. Compile
  5. Run and test
  6. Imagine improvements

Steps 1, 2 and 6 you can do in your head, but steps 3, 4 and 5 need to be done on a computer. For step 3 you need a word processor (text editor) of some kind. For step 4 you need the Java compiler. For step 5 you need the Java Virtual Machine. To work on the examples in Java Outside In you will need access to the Java code discussed in the text.

There are three ways you might arrange to have all these software tools available on your computer. Some combination will work for you.

Just get Java ...

The Java compiler and the Java Virtual Machine are available free for Windows, Solaris or Linux at http://java.sun.com/. You should download the latest production version of the JavaTM2 Platform, Standard Edition (J2SETM) from http://java.sun.com/j2se/downloads.html.

If you are using a Macintosh computer you will find these tools already installed as part of Mac OS X. For earlier versions of the Macintosh operating system, search the web for information.

Once you have installed Java you may write your programs using any word processor you like. On a Windows PC Microsoft Word, or just plain Notepad will do. On Unix or Linux you will use either vi or emacs as an editor. Compile and run your program from any command prompt.

You can get a free emacs editor for Windows, Unix/Linux or Mac OS X at http://www.xemacs.org/Download/. Warning: emacs is a powerful programming editor but not easy for beginners.

Integrated environments

In the real software world editors and compilers are usually combined in an IDE - an integrated development environment. The editor will display language keywords and comments in different colors. It may prettyprint for you. You can compile and run programs without leaving the environment, which will help you locate errors in your code. Here are several you might want to consider: A Google search for "Free Java IDE" will turn up more candidates. Some of these environments may come with Java installed, in which case you won't need to get a copy separately.

Using classes from the library

The Java compiler and the Java Virtual Machine know how to find all the classes (like String) that come with the Java library. But there are times when your program needs access to other classes that you have not written. In particular, many of the programs in Java Outside In use the Terminal class. You can make such classes available to your program in several ways.

Off you go. Have fun!