Linux 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 your home directory
    Open a terminal window and issue the two commands:

    cd
    mkdir workspace_xxxx


    The first takes you to your home directory and the second creates the working directory.

  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 your home directory
    Open a terminal window and issue the two commands:

    cd
    mkdir typeAPI


  2. Download this file and store it in the "typeAPI" directory
    Right-click the above link; choose to save it; navigate to your newly-created "typeAPI" directory; 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 one or more files with a red download symbol next to each. The file you need depends on your O/S. For RPM-based Linux platforms (such as Red Hat and SuSE), choose the rpm file. For non-RPM ones (such as Ubuntu), choose the bin self-extracting file. Right-click the chosen file and choose to save it in your home directory keeping its name unchanged.

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

  8. Open a terminal and go to your home directory to install the JDK.

  9. Become root by issuing the su command and make the downloaded file executable by issuing chmod u+x.

  10. Execute the file by typing ./ followed by its name.

  11. The JDK installation directory is named jdk1.x.y_uu where x and y are the (major and minor) release code and uu is the update code. Its location depends on your O/S. It can be under your home directory or under /usr or elsewhere. You must find out its path and include its bin subdirectory in your path. See this page for help.

  12. 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: ... /jdk1.x.y_uu/jre/lib/ext) keeping its name, type.jar, unchanged.

  6. Verify that the file is indeed present in the correct directory under the correct name and has the same size as indicated next to its download link.

  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. Open a terminal window. The terminal is your console.

  2. Issue the following commands:

    cd ~/workspace_xxxx
    jar -xf ws.jba


    This will unzip the working directory files that come with your book. Verify (using the "ls" command) that your working directory is now populated with several files. If the above command led to an error message (such as jar: command not found) then either the path was not set correctly or the JDK has not been installed. In that case, ensure that your path environment variable points at jdk1.x.y_uu/bin.

  3. 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.

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

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

  6. 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".

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

  8. Return to the setup list.