ICS 111 - Introduction to Computer Science I - Lab

IntroductionContact your TAEclipse SetupEclipse BasicsjGRASP SetupAssignmentsNotes from Lab

jGrasp Setup:

Step 1:  Download and Install Java 1.5.0
Note:  Be sure to Un-install any previous versions of Java on your machine first!!!

Go to this web page:  http://java.sun.com/j2se/1.5.0/download.jsp

Click on 'Download JDK 5.0 Update 8'  (third item down)

You will have to click 'Accept' in the agreement, then you can choose your download.  If you have a PC, you will probably want the first group (Windows platform).  You can choose whether to use their online installation or offline installation- either one will work.  The only difference is that the online install will download files during the installation, while the offline downloads all files before the installation.

While Java is downloading, you may want to get Mozilla Firefox for your PC.  We will be making applets, which display through a web browser, and I (personally) have had better luck using Mozilla.  Mozilla should be installed before you install Java, so that it can set up the Java Runtime Environment (JRE) in all of your browsers.  Mozilla Firefox can be downloaded from www.mozilla.org.

After downloading, run the installer on your machine- this will install the Java platform to your hard drive.  Follow the instructions- the installer should ask towards the end which browser to set up its Virtual Machine / Java Run Time Environment (JRE) - make sure you allow it to do this on the browser(s) you will be using for the class- it will save you problems later on.  (Your assignments will be tested in a browser).

Step 2:  Download and Install jGRASP

Go to this webpage:  http://spider.eng.auburn.edu/user-cgi/grasp/grasp.pl?;dl=download_jgrasp.html

If you have Windows, Click on the 'jGRASP exe' button.  On this page, you can download jGRASP for other operating systems such as Mac OS if that is what you have.  The download page will look something like this:

After downloading, run the installer and install jGRASP to your system.  Remember to make sure you have already installed the Java SDK (Step 1).

Step 3:  Setting up the Wheels package (not necessary for our early programs- come back to this step later on in the class)

The 'Wheels' package is something the book uses to help you learn Java, but this package is not included in the Java installation.  Therefore, you will need to visit the book's website, and download the package so that you can use it on your assignments throughout the semester.

Go to this webpage:  http://wps.aw.com/aw_sanders_oopjava_1/0,10889,2403930-,00.html

Click on 'WHEELS', then click on 'Download WHEELS'.


Note:  These Instructions may change- so check back later for updates.

After downloading 'Wheels.zip', open the zip file, and extract to your Desktop (or somewhere else you can remember) to a folder called 'wheels'.  Upon opening the folder, it should look like this:
(Note:  Java is case-sensitive, so make sure your 'wheels' folder is all lower-case)

To use the 'wheels' code, make sure these files are in the same directory as the program you are writing that is utilizing the wheels package.

 

Step 4:  Starting a new program in jGRASP

Open up the jGRASP program, and go to the 'File' menu -> New -> Java:

Then you will get a new window in the workspace for you to type in your Java Program. 

When you are ready to compile your code, go to the 'Build' menu and click on 'Compile', which will then attempt to compile your program.  Error messages will appear at the bottom of the screen, as seen above.  You can also compile by clicking the green '+' icon.

To run your program, go back to the 'Build' menu, then click 'Run'.  Your program will run in the window at the bottom of the screen in the same window you receive error messages- and will only run the program if it has compiled properly.  You can also run the program by clicking the red 'running man' icon, next to compile.

Feel free to play around with the buttons and options in jGRASP so you can get a feel for what they do.  Some options can do things like show the line numbers and allow you to trace through the logic of your code, which can be very helpful when you are debugging errors in your program.

At this point, you are ready to write programs using jGRASP!

 

Any questions, please contact your TA