Windows Development Environment


The Setup List

You need to set up six different pieces:
  1. Working Directory
    A directory (aka workspace) in which all your programs are stored.

  2. API
    Documents that define how to interface with the Java and TYPE library classes.

  3. JDK
    The Java Development Kit.

  4. TYPE
    A family of programs and packages that come with the Java By Abstraction textbook.

  5. Editor
    A program that allows you to create, modify, and save source programs.

  6. Console
    A window (aka terminal) in which you run your programs and interact with the environment.

Click these links one by one, and in the order shown, in order to set up each piece. The last task in each link brings you back to this setup list so you can continue with the next link. Once you are done with the last link, you will have completed the setup of the development environment.




Working Directory

Follow these steps to create and populate your working directory:
  1. Decide on a name for your working directory
    Perhaps workspace_xxxx, where xxxx is the course number.

  2. Create a directory with that name under My Documents
    Open the "My Documents" folder; right-click its background; choose New then Folder; then type in the chosen name.

  3. Download this file and store it in your working directory
    Right-click the above link; choose to save it; navigate to your newly-created working directory; and save the file keeping its name, ws.jba, unchanged.

  4. Return to the setup list.




API

Follow these steps to download and establish access to the API's of TYPE and Java:
  1. Create a directory named typeAPI under My Documents
    Open the "My Documents" folder; right-click its background; choose New then Folder; then name the folder "typeAPI".

  2. Download this file and store it in the "typeAPI" folder
    Right-click the above link; choose to save it; navigate to your newly-created "typeAPI" folder; and save the file keeping its name, typeAPI.jba, unchanged.

  3. Bookmark this site
    Click the above link. A new window (or tab) will be opened by your browser. Switch to it and add it to your bookmarks (or favorites) under the name "javaAPI".

  4. Close the newly opened window (or tab) and return to this page.

  5. Return to the setup list.




JDK

Follow these steps to download the Java Development Kit:
  1. Click this link.

  2. A new window (or tab) will be opened by your browser. Switch to it to see the Java SE Download page.

  3. Click the button that says "Download JDK". Note that we are after the JDK not the JRE.

  4. This will take you to a new page. Click its "Download" button and, again, make sure you downloading the Java SE JDK.

  5. This will take you to a page in which you select the platform of your machine. Use the drop-down list to do so and then click "Continue".

  6. The final page contains a link to a file of a given size and a red download symbol next to it. Right-click that link and choose to save it on your desktop keeping its name unchanged.

  7. Once the download is done, close the newly opened window or tab, and return to this page.

  8. Double-click the file that you have just downloaded to your desktop. This will launch its setup utility.

  9. Accept the defaults but write down the name of the directory in which the JDK will be installed because you will need it later. It is typically of the form C:\Program Files\java\jdk1.x.y_uu where x and y are the (major and minor) release code and uu is the update code.

  10. Start the installation of the JDK. Once it completes, the utility will prompt you to start the installation of the bundled JRE. Click "Next" to do so.

  11. After the JRE is installed, click "Finish". Note that product registration is optional.

  12. Verify that the installation folder has indeed been created and populated.

  13. Return to the setup list.




TYPE

Follow these steps to download the TYPE software:
  1. Visit this site.

  2. A new window (or tab) will be opened by your browser. Switch to it to see the TYPE site.

  3. Click "Download" on the left sidebar.

  4. Follow the top link that says: "The TYPE Software".

  5. Right-click the link that appears at the top of that page; it is entitled type.jar. Choose to save it in the lib\ext subdirectory of your JDK (i.e. in the directory: C:\Program Files\java\jdk1.x.y_uu\jre\lib\ext) keeping its name, type.jar, unchanged. Make sure you are saving the file in the location specified above and not in C:\Program Files\java\jre... which also has an ext.

  6. Verify that the file is indeed present in the correct folder under the correct name and has the same size as indicated next to its download link. You can do that by starting with My Computer on the desktop and then navigating through the directory tree. Once you reach the file, right-click it and choose Properties in order to see its exact size on disk in bytes.

  7. Close the newly opened window (or tab) and return to this page.

  8. Return to the setup list.




EDITOR

Follow these steps to download and configure an editor:
  1. Visit this site.

  2. A new window (or tab) will be opened by your browser. Switch to it to see the TYPE site (again).

  3. Click "Download" on the left sidebar.

  4. Follow the bottom-most link that says: "Editors".

  5. This takes you to a page that allows you to download and install an editor. Follow its instructions.

  6. Close the newly opened window (or tab) and return to this page.

  7. Return to the setup list.




CONSOLE

Follow these steps to set up your console:
  1. Locate the Command Prompt (also known as the DOS Prompt) shortcut in your Start menu. You will likely find it under Programs, Accessories.

  2. Copy this shortcut to your desktop by right-clicking it and choosing "Copy" and then right-clicking your desktop and choosing Paste.

  3. Right-click the created desktop shortcut and choose Properties. Type under "Start in" the full path to your working directory, i.e. \My Documents\workspace_xxxx (where workspace_xxxx is the name of the working directory you created earlier).

  4. Click the shortcut. It should launch the console window and you will find yourself in your working directory. Verify by issuing the command: dir (which lists all the files in the current directory). You should find the ws.jba file we downloaded earlier. If not, type exit and re-do the previous step making sure the shortcut has your working directory as its "Start in".

  5. Issue the following command in the console window. You can simply copy it from here and paste it in the console (paste in the console is accessible by clicking the upper-left corner of its window):

    set path=c:\"program files"\java\jdk1.x.y_uu\bin;%path%

    where x, y, and uu are the release and update codes of the JDK you installed earlier.

  6. Issue the command:

    jar -xf ws.jba

    This will unzip the working directory files that come with your book. Verify (using the "dir" command) that your working directory is now populated with several files. If the above command led to an error message (such as 'jar' is not recognized as an internal or external command) then either the path was not set correctly or the JDK has not been installed. In that case, redo the previous step and ensure the JDK location is specified correctly.

  7. Issue the following two commands:

    cd ..\typeAPI
    jar -xf typeAPI.jba


    The first takes us to the typeAPI directory that we created earlier while the second unzips the TYPE API.

  8. Close the console window by issuing the exit command.

  9. Navigate from your desktop to the typeAPI folder and double-click the file index.html in it.

  10. A new browser window (or tab) will open and it will display the TYPE API that you downloaded earlier and have just unzipped. Add it to your bookmarks (or favorites) under the name "typeAPI".

  11. Close the newly opened window (or tab) and return to this page.

  12. Your console is now configured but everytime you start it you will need to issue the path command. To avoid this nuisance, we will change the path once and for all at the system level. To that end, locate the Environment Variables in the Control Panel (likely under System, Advanced).

  13. One of the environment variables is Path. Edit it and prefix it with:

    c:\"program files"\java\jdk1.x.y_uu\bin;

    Save the changes.

  14. To verify that the path is now set, open the console (by clicking its shortcut on the desktop) and issue the two commands:

    javac -version
    java -version


    Both commands should work without errors and both should display the same version. If not, the path is not set correctly. You can issue the command:

    path

    (without any arguments) and it will display the set path. Compare it to what it should be and re-do the previous step.

  15. Issue the exit command to close the console.

  16. Return to the setup list.