Linux Development Environment
The Setup List
You need to set up six different pieces:
- Working Directory
A directory (aka workspace) in which all your programs are stored.
- API
Documents that define how to interface with the Java and TYPE library classes.
- JDK
The Java Development Kit.
- TYPE
A family of programs and packages that come with the Java By Abstraction textbook.
- Editor
A program that allows you to create, modify, and save source programs.
- 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:
- Decide on a name for your working directory
Perhaps workspace_xxxx
, where xxxx
is the course number.
- 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.
- 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.
- Return to the setup list.
API
Follow these steps to download and establish access to the API's of TYPE and Java:
- Create a directory named typeAPI under your home directory
Open a terminal window and issue the two commands:
cd
mkdir typeAPI
- 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.
- 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".
- Close the newly opened window (or tab) and return to this page.
- Return to the setup list.
JDK
Follow these steps to download the Java Development Kit:
- Click this link.
- A new window (or tab) will be opened by your browser. Switch to it to see the Java SE Download page.
- Click the button that says "Download JDK". Note that we are after the JDK not the JRE.
- This will take you to a new page. Click its "Download" button and, again, make sure you
downloading the Java SE JDK.
- 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".
- 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.
- Once the download is done, close the newly opened window or tab, and return to this page.
- Open a terminal and go to your home directory to install the JDK.
- Become root by issuing the
su
command and make the downloaded file executable
by issuing chmod u+x
.
- Execute the file by typing
./
followed by its name.
- 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.
- Return to the setup list.
TYPE
Follow these steps to download the TYPE software:
- Visit this site.
- A new window (or tab) will be opened by your browser. Switch to it to see the TYPE site.
- Click "Download" on the left sidebar.
- Follow the top link that says: "The TYPE Software".
- 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.
- 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.
- Close the newly opened window (or tab) and return to this page.
- Return to the setup list.
EDITOR
Follow these steps to download and configure an editor:
- Visit this site.
- A new window (or tab) will be opened by your browser. Switch to it to see the TYPE site (again).
- Click "Download" on the left sidebar.
- Follow the bottom-most link that says: "Editors".
- This takes you to a page that allows you to download and install an editor. Follow its instructions.
- Close the newly opened window (or tab) and return to this page.
- Return to the setup list.
CONSOLE
Follow these steps to set up your console:
- Open a terminal window. The terminal is your console.
- 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
.
- 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.
- Close the console window by issuing the
exit
command.
- Navigate from your desktop to the typeAPI directory and double-click the file index.html in it.
- 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".
- Close the newly opened window (or tab) and return to this page.
- Return to the setup list.