Java Development Resources

Eclipse

We use the Eclipse IDE (Interactive Development Environment) for creating and running the Java programs for this course. You should already have this application installed on your PC - if you don't consult your instructor.

Eclipse is maintained by the Eclipse Foundation (www.eclipse.org).

Configuration of the Eclipse Workspace

When you install Eclipse, it creates a default directory where your work is stored. You may be interested in organizing your lab projects into a separate directory hierarchy. If so, follow these instructions:

  1. Start Eclipse.

  2. Select "Switch Workspace..." from the File menu. In the dialog box that follows specify the directory where you will store your java programs for this course. A good location is My Documents\MyLabs. Note that specifying any location under the C:\Program Files directory is not a good idea, since Windows write-protects that directory against inadvertent modifications.

  3. When you acknowledge the change, Eclipse will automatically shut down and restart, using the new workspace directory.

You can repeat the above steps to create as many workspaces as you want. After switching workspaces, you'll probably create a new project in that workspace:

Select “File->New->Project”; create a “Java” project and select “Next”. For your project name, enter the project name, e.g. “Lab1”. Note that this will result in the creation of a file directory called Lab1 under the My Documents\MyLabs workspace directory (or whatever directory you specified for your workspace).

You can always use the "Switch Workspace..." command to switch back to your previous workspace.

Content Help

The Eclipse IDE can provide content help (e.g. explanation of the usage of a particular method) on the various Java classes, but you may have to configure your project first before this help information is made available. In order to make it available, browse your current project in Eclipse using the Package Explorer. There, you'll see an entry called "JRE System Library". When you expand that entry, you'll see a number of Java libraries that are accessible by your project; the "rt.jar" library is the one to focus on here. Right-click on rt.jar, and select the "Properties" entry from the context menu. A Properties dialog will appear on your screen. Within this dialog, navigate to the "Java Source Attachment" page. On this page, you specify the location of the src.zip file than was installed on your PC as part of the JDK installation. The file is normally in C:/Program Files/Java/jdk1.5.0/src.zip, or somewhere similar depending upon where you installed your version of the JDK. In the textbox, enter the path to this file and press the OK button on the dialog. This should enable the content help feature.

Additional textbook material

The textbook author, C. Thomas Wu,  publishes a website (www.drcaffeine.com) related to the textbook. The site contains various items of general interest to Java programmers, including a couple of resources that I'm reproducing here for those of you that might find them interesting. Here is a paper on the Java programming style & conventions, and here is a paper on using JavaDoc, the Java documentation comment notation.

Java Documentation

Sun Microsystems maintains the following sites of interest to the Java student:

http://java.sun.com This is the starting point for all things related to Java.

http://java.sun.com/j2se/1.5.0/docs/api/  This is the link to online Java documentation.

http://java.sun.com/j2se/1.5.0/download.jsp Use this link to download a local copy of the Java documentation to your PC, so that you can access the docs even when you are offline. This requires about 165MB free space on your disk drive.