Java Development Resources

For Java programs, we use the Eclipse IDE similar to that used in SE1010. You should already have a copies of these on your PC; if not, let me know and I'll get you them.

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

IDE Configuration

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 example location is My Documents\MySE1020Labs. 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.

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

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/javase/6/docs/api/  This is the link to online Java documentation.

http://java.sun.com/javase/downloads/index.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.