You will need to install, at most, two pieces of software: The Java Development Kit (JDK) and the jGRASP editor. The directions differ based on your operating system.
Follow the above link and click the button labeled, JDK 6 Update 16. (Not the "JRE" link). Please be careful to choose to download JDK and not JRE. JRE just allows you to run other people's Java programs, not compile and create your own programs. You must choose JDK instead.
Note: Sun updates JDK frequently; by the time you read these directions, it may be JDK 6 Update 17 or something like that. The directions should be the same otherwise. Our screenshot below is probably out of date by now as well, since we don't update it unless the page appearance changes.
Accept the License Agreement and choose the "Windows Platform, Offline Installation, Multi-language JDK file": jdk-6u16-windows-i586.exe (73.54 MB)
Once you have finished downloading this file to your Desktop, you must install JDK on your system. Do this by double-clicking the JDK installer file you saved on the Desktop.
You can choose all the default options during installation.
From the jGRASP web site link above, click the button at top-right labeled Download jGRASP. You will be taken to a download page with some survey information. You may skip this. Underneath the survey is a set of buttons. Click the jGRASP exe to download a file named jgrasp187_02.exe. Save the file to your Desktop or another convenient location.
Once you have finished downloading this file to your Desktop, you must install jGRASP on your system. Do this by double-clicking the jGRASP installer file you saved on the Desktop. Once you are done installing jGRASP, you should now have icons on your Desktop and in your Start Menu for running jGRASP.
We have had particular problems come up for students using Windows Vista 64-bit edition. If you have Vista but aren't sure whether it's the 64-bit edition, you can follow these instructions to find out:
For a system that is 64-bit, you will see something like the following (the note about 64-bit appears about three-quarters of the way down):
If you have a Windows-64 machine, then when downloading the JDK, you should list your platform as "Windows x64."
We've found that there is sometimes a problem with jGRASP that it doesn't install properly on 64-bit machines. Most people are finding that when they try to compile a program, they get an error message like this:
----jGRASP wedge2 error: command "javac" not found. ---- This command must be in the current working directory ---- or on the current PATH to use this function. ---- PATH is ---- "c:\videos;C:\Windows\system32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\hp\bin\Python;C:\Program ---- Files (x86)\UWICK\SSH Tectia\SSH Tectia AUX;C:\Program Files ---- (x86)\UWICK\SSH Tectia\SSH Tectia AUX/Support binaries;C:\Program Files ---- (x86)\UWICK\SSH Tectia\SSH Tectia Broker;C:\Program Files ---- (x86)\UWICK\SSH Tectia\SSH Tectia Client". ---- ---- Make sure you have the full JDK (J2SE SDK or other), not just the JRE, ---- installed. ---- The J2SE SDK is available from java.sun.com. ----jGRASP: operation complete.
If you are seeing this message, then follow these instructions:
Notice that the variable value includes the directory name "jdk1.6.0_16". If you found that the JDK is stored on a different directory, then use that directory name instead of this one. Everything else should appear exactly as it is listed above with no spaces.
Variable name: path Variable value: %path%;c:\program files\java\jdk1.6.0_16\bin
What we are doing in setting up this environment variable is telling the system to look into the "bin" folder (short for "binary") of the JDK installation when it looks for programs like "javac", which is the Java compiler. Once this change is made, you should restart jGRASP and it should work.
If you have any problems, please email the head TA or the instructor.
Macs with the OS X operating system will have Java available automatically, but you may need to install the latest Mac version of JDK, version 6.0. Some newer Macs (purchased within the last 6 months or so) already have this software, but older ones do not. If you have a fairly new Mac, you may want to try to skip to Step 2 and see if jGRASP works, and if not, come back to this step.
If your Mac doesn't have Java installed already, you can go to this web page to download it:
http://developer.apple.com/java/download/
If you have Mac OS X v10.5 "Leopard", you want to choose the link that says Java for Mac OS X 10.5, Update 1. If you have the older v10.4 "Tiger" version of OS X, you should choose "Java for Mac OS X 10.4, Release 6". You can see your OS X version by clicking the Apple icon on the top-left of your screen and choosing "About this Mac."
Once you've downloaded the file, double-click it on your desktop to install it.
There is a Mac version of jGRASP, available from the same jGRASP web site by clicking the button labeled jGRASP pkg.tar.gz. Download this file and open it, then drag the jGRASP program to your Applications folder to install it.
Some students are reporting issues with jGRASP on the Mac. Some report seeing the following strange message:
share cache file is corrupt: /var/b/yl/yl_share_cache_ppc
If you see this message, you should update your Mac to Java v1.6 by running the Mac's built-in Software Update tool. Then re-run jGRASP and click Settings, jGRASP Startup Settings, and set your Java version to 1.6.0.
println
messages on the console. We don't know what is causing this. If you have this bug, let us know what kind of Mac you have (Intel or PPC? What OS X version? etc.) and we'll try to figure it out.(These directions are a few months out of date, but the general idea can still be followed.)
It's tougher to give an installation guide for Linux because of the large variety of different distributions and architectures. Here is a rough guide that will work for many distributions such as Ubuntu.
http://java.sun.com/javase/downloads/index.jsp
Follow the above link and click the "Download" button next to the "JDK 6.0 Update 3". (NOT the "with NetBeans 5.0" link or the "with Java EE" link or others). Accept the License Agreement and choose the "Linux self-extracting file" file:
jdk-6u3-linux-i586.bin
(If you use a Linux distribution that supports RPM packages such as Fedora Core, you may wish to use the "Linux RPM in self-extracting file" package.)
Once you have finished downloading the JDK .bin file, open a terminal window and execute the file. You may have to give execution permissions to the file:
chmod +x jdk-6u3-linux-i586.bin ./jdk-6u3-linux-i586.bin
Running the .bin file extracts the JDK contents. Move these to a directory of your choice. (The rest of this tutorial assumes you have moved the JDK to /usr/lib/jdk/ .)
After installing Java, you will probably wish to add Java's directory to your PATH setting, so that you can run Java commands from your terminal. To do so, edit the file .bashrc in your home directory and add the following lines to the end of it:
export PATH=/usr/lib/jdk/bin:$PATH export CLASSPATH=.
You should close your terminal and open a new one for the PATH changes to take effect.
There is a Linux version of jGRASP, available from the same jGRASP web site by clicking the button labeled jGRASP zip. Download this file and extract its contents. Then open a terminal and cd
to the directory of those contents and type:
java -jar jgrasp.jar
If you are unable to get the jGRASP debugger working in Linux, try downloading the following jgrasp
BASH script file and putting it in the jgrasp/bin
folder. Give it execute permissions (chmod +x
) and then use it to run jGRASP.
jgrasp bash script
By default, Windows does not show extensions of certain types of files. This can lead to confusion because you may not know which file is your .java program and which is your .class compiled file.
If you'd like to change this value, open My Computer. From the window's main menu, click the following:
Tools, Folder Options...
A Folder Options window will appear. Click the tab labeled View, then find the checkbox labeled Hide extensions for known file types. Uncheck it. Press OK.
Now all files should show their extensions in Windows.