Java 7 and jGRASP 2.0 install instructions

This page is largely leveraged off from Marty Stepp at the University of Washington. Thanks, Marty! (copied from: http://www.cs.washington.edu/education/courses/cse142/13wi/working_at_home.shtml)

You will need to install, at most, two pieces of software: The Java Development Kit (JDK) and the an editor. You may choose between Eclipse and jGRASP or install both. Though Eclipse is an industry-grade editor, you may find it more trouble than it’s worth – demonstrations will use jGRASP in the classroom. jGRASP involves learning to use two buttons and just works. The directions differ based on your operating system.

NOTE: The instructions that follow have the links and instructions for an earlier version of the Java JDK is version 7 update 25. The instructions should still apply to later versions. Sun updates Java frequently with fixes and improvements but we only update this page when there are significant changes to the pages.

1) Install Java Development Kit (JDK)

Go to the following Oracle Java download page. From the menu, choose your operating system, then press the “Download”button.

Select the appropriate platform in the menu below:

Approve Terms of UseSelect Java 7

You do not need to register or sign in.

Once you have finished downloading this file to your Desktop, you must install the JDK on your system. Do this by double-clicking the JDK installer file you saved on the Desktop.

Click to install

Follow default instructions

You can 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_21.exe. Save the file to your Desktop or another convenient location.

  • NOTE: Some people who use Windows Vista or Windows 7 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.)

Select Download

download jGRASP


Extra information for Windows Vista 64-bit:

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 install

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 or will download and install it automatically, so you should 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 last 3 years or so) may already have this software, but older ones do not. If you have a fairly new Mac, 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. Once you’ve downloaded the file, double-click it on your desktop to install it.

  • Find jdk-7u10-macosx-x64.dmg on this page. Be sure to “Accept License Agreement.”

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

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.

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-getpackage 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 andcd 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 followingjgrasp 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


Eclipse

First, make sure you have correctly installed the JDK for your operating system. If not, please scroll up and follow directions. Then, download and install the appropriate Eclipse installer from this page.


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.