Java Workshop

Java Workshop is free Java environment available from Sun Microsystems. There are versions for Solaris and Windows. The environment is easy to use, contains a nice debugger, and the price is right.

Compiling a program

To compile a program, follow these steps:

  1. Select File | New | Project... from the menu. You get a dialog box like this:
    {short description of image}
    Type a project name that matches the name of your program (such as Coins6, RectangleApplet or Homework1). Click the Standalone button if you want to create an application. Click the Applet button if you want to create an applet.
    When you are done, click on Next>.
  2. You get a dialog to specify the project file location.
    Pick a directory for your work, such as c:\yourname\homework
    Tip: It is best to use a separate directory for each project.
    {short description of image}
  3. If you already have a source file (for example, because you want to try out one of the files that came with the book), answer Yes to the question "Are there files already in that directory that should be added to the project?" and then click on Next>. Otherwise, answer No and click on Finish.
  4. If you just selected Yes in the previous step, you get the following project files dialog. If you selected No, skip ahead to the next item.
    Click on the Add... button and add the source file for your program.
    {short description of image}
    When you are done, click on Finish.
  5. Now your program file is loaded into the environment. If you started a new program, a few lines of stock code have been added. Just remove the ones that you don't need. Edit your program as appropriate.
    To compile the program, select Build|Build from the menu. Any errors are displayed in the Build window. The current error is highlighted.
    {short description of image}

Running your program

To run your, select Project|Run from the menu. Any output is sent to the Java Console window. You type input into that window as well.

{short description of image}

Note: You need to click with the mouse into the Java Console window before you can type into it.

Note: If you run an applet, then Java Workshop automatically fires up the applet viewer with an appropriate HTML file. You do not need to author the file. Hooray for this timesaver.