Working at Home

(last updated Thu Sep 29, 2011)

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.


Windows users:

1) Install Java Development Kit (JDK)

Go to the following Oracle Java download page. Click the large button labeled "Download Java Platform (JDK) 7".

  • download JDK

You will be taken to a new page with the heading, "Java SE Development Kit 7 Downloads." Scroll down to the section labeled "Java SE Development Kit 7." You will see a list of files to download for various operating systems. Click Accept License Agreement, and then click the appropriate link for your operating system to download the file. For Windows users, you should choose jdk-7-windows-i586.exe. (Unless you use 64-bit Windows, in which case you want jdk-7-windows-x64.exe. If you aren't sure, click here for more info.)

  • download JDK
  • download JDK

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.

  • download JDK
  • download JDK

You can just repeatedly click Next to choose all the default options during installation.

2) Download jGRASP editor

Go to the following web page to download the jGRASP editor software to work on Java programs for this course:

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 can just scroll down and skip the survey. Underneath the survey is a set of buttons. Click the jGRASP exe to download a file named jgrasp188_12.exe. Save the file to your Desktop or another convenient location.

  • NOTE: Some people who use Windows 7 or Windows Vista may need to choose to "Download Jar File" rather than "Download Windows App."

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.

  • download jGRASP
  • (Our screenshots show an older version number, but the overall process is the same.)
  • download jGRASP
  • download jGRASP

Extra information for 64-bit Windows:

We have had particular problems come up for students using the 64-bit edition of Windows. This section discusses those issues and how to work around them.

How do I know if I have 64-bit Windows? If you have Windows 7 or Vista but aren't sure whether it's the 64-bit edition, follow these instructions to find out:

  • Click the Start button, then choose Control Panel.
  • Click System and Maintenance, then System.
  • Now you should be seeing "Basic information about your system", including whether it is 64-bit.

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):

  • 64-bit instructions

If you have a Windows-64 machine, then when downloading the JDK, you should list your platform as "Windows x64." There seems to be a problem with jGRASP that it doesn't install properly on 64-bit machines. 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.
		

One student fixed this problem by following these steps:

"I was able to get jGRASP to be used. At first I was expecting the program not to work correctly and I tried different things first. I installed the JDK 64 bit version first which caused the error wedge2 error. I then decided to use compatibility mode to XP SP 2, which that cause a whole entire new error. Then I installed the traditional 32 bit JDK and turned off compatibility and it somehow worked."

So, in other words, installing/using the standard 32-bit JDK rather than the 64-bit one may be the best choice at this time.


Mac OS X:

(Special thanks to CSE 142 student Corey Geller for the Mac OS X installation screenshots!)

1) Install Java Development Kit (JDK)

Macs with the OS X operating system will have the Java compiler available automatically, so you might be able to skip this step. But many Macs have an out-of-date version of JDK, so you may need to install the latest Mac version of JDK. Some newer Macs (purchased within the six months or so) may 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. You might also want to run your Mac's built-in Software Update feature to see if it updates your Java for you.

You can test whether your Mac has Java installed (and if so, what version) using the Terminal application. To run the terminal, use your Spotlight icon at the upper-right of your screen to search for Terminal. It will find and suggest the Terminal application. Click it to run the terminal. A white window will appear with black text and a blinking cursor for you to type commands. Type the following command and press Enter, to see your version of Java:

java -version

If your Mac doesn't have Java installed already (or has an obsolete version installed), you can go to the web page below to download it. Choose the link that matches your version of Mac OS X. 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.

The preceding downloads come as .dmg disk images. Once you download one of them, you double-click it in the Finder to mount it as a temporary disk. Inside is a .pkg file representing the JDK application installer. Run this .pkg file to install JDK.

  • screenshot
  • screenshot

2) Download jGRASP editor

http://jgrasp.org/

There is a Mac version of jGRASP, available from the same jGRASP web site by clicking the button labeled jGRASP pkg.tar.gz. This file is a compressed archive that contains the jGRASP installation file (.pkg) inside it. Once you have downloaded the .tar.gz file, open it up to extract its contents. (Some Macs don't understand how to extract the contents of a .tar.gz file. You might need to download a decompressor like Stuff-it Expander to help you with this.)

  • screenshot

Once you have extracted jGRASP application PKG file from the archive, double-click it to install jGRASP. At each screen, you can choose the default options and click "Continue" or "Install" to move forward. If you've done it correctly, you will see an "Install Succeeded" message and a green checkbox.

  • screenshot
  • screenshot

Once jGRASP is installed, you can run it from your Applications folder, Dock, or by typing "jgrasp" into your Spotlight search at the top-right of your screen.

Common Mac jGRASP issues:

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

  • If you see an error message on startup of jGRASP that has a "jGRASP Startup Settings" button, click it. Then where it says "Java executable (for running jGRASP):" it will probably say [Default]. Clear that out and instead, type in:
    /usr/bin/java
    

    Click "Ok" and close the error message window. Then re-open jGRASP and the problem may go away.

  • Some students are reporting that characters are missing from their 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.
  • If you continue having problems with jGRASP, you may want to try another Java editor named DrJava.

Linux:

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

1) Install Java Development Kit (JDK)

If you use Ubuntu Linux (or a derivative thereof), you can install Java through their apt-get package manager system. Type the following three commands:

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

Otherwise, get Java from Sun/Oracle's web site:

http://java.sun.com/javase/downloads/index.jsp

Follow the above link and click the "Download" button next to the "JDK 6.0 Update 21". (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-6u26-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-6u26-linux-i586.bin
./jdk-6u26-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.

2) Download jGRASP editor

http://jgrasp.org/

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

3) Set Up BASH Script File (optional)

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.

icon jgrasp bash script


Useful Options for Your Operating System

Enable File Extensions in Windows:

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.