Getting The Software

In order to be able to write programs in Java at home, you’ll need to obtain and install some software.  It's all free for personal use.  It's also included in the Thompson edition of the textbook, on a CD-ROM that's at the back of the book.  If you're using an earlier version of the book, or you don't have the CD, you can freely download this software from the Internet.  Some of these files can be quite large (37+MB), so I’d recommend downloading this stuff while at school (the networks here are pretty fast), and carrying it home either on a Zip disk, or CD-R (or CD-RW).


This software has also been installed on the classroom computers (in room 231), the hallway computers, and some of the computer in the Open Learning Center here at Cascadia.  For the 2009 Spring term you may need to configure jGrasp for your use, so you can skip to Step 6.

You should anticipate spending as much as 2-4 hours to get all your software downloaded and installed correctly, more if you’re trying to download this stuff over a slow connect.  As such, you should allot enough time to both get all this software AND to actually do your first homework assignment.  If you can’t get this to work, please ask and I’ll try and help out.  If you have a laptop you are encouraged to bring the laptop to class so that the instructor can trouble-shoot any problems directly on your computer.

 

Do remember that Cascadia has public computer labs which you can use – if nothing else, you can always go there and use those computers.  As such, I won’t accept excuses such as “My homework is late because I couldn’t install the software”

 

  1. Download the Java SE Development Kit (JDK)
    (This step has already been done for you on the computers at Cascadia)
    (If you have the version of the textbook published by Thompson publishing, you will find this software on a CD-ROM at the back of the book)


    First, you need to get the Java Development Kit (JDK) from the company that makes it, Sun Microsystems.  Luckily, they give it away for free :)

    We want to get the JDK that contains the product known as “Java 2 Platform, Standard Edition (Core/Desktop)” (J2SE).  The JDK itself is given a separate version number –It’s important that you get version 6 (or later) of the JDK (which contains version 6 of the Java programming language).  

    A link to the correct file to download is:
    http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html
    (Oracle has decided to bury the Windows version of the JDK most of the way down the list - it's the link that reads "jdk-6u26-windows-i586.exe")
    (You will need to click on the 'accept the agreement' radio button before doing the download)

    Note that the website contains their most recent version of the software, so if they update the JDK and I don't notice, it'll be ok for you to get that newer version.  Example: I tell you to get version 6u26, and they've replaced it with 6u32.  As long as the numbers are equal to or higher the ones I specify, you should be fine (6u32 is 'bigger than' 6u26).

    It’s also very important that you get (and install) the JDK first, since a number of other software packages require the JDK to be installed before them.  Note that there’s a Java Runtime Environment (JRE). This  ISN’T enough – it will let you run Java programs that other people have created, but won’t let you create any on your own. 

    Lastly, if you previously installed a version of Java (say, version 1.4 from either the JRE or the JDK) I’d recommend un-installing the prior version, then  installing this version.  If you do this, make sure to put the new JDK into the same location as your old one.

    Make sure that you download the file from column labelled "JDK" (or "SDK"), instead of the JRE.  The JRE ("Java Runtime Environment") contains all the software that you need, in order to RUN Java programs, but not WRITE/CREATE Java programs.  The JDK ("Java Development Kit") or SDK ("Software Development Kit") contains everything you need to DEVELOP/WRITE/CREATE Java-based software in addition to running Java programs.
     
  2. Download the JDK documentation
    (This step has already been done for you on the computers at Cascadia)

    Oracle maintains documentation for Java programmers on-line at

    http://download.oracle.com/javase/6/docs/api/

    While this is convenient, you can only use it if you’re on-line.  You can also download your own copy of most of the documentation by going back to:

    http://www.oracle.com/technetwork/java/javase/downloads/index.html

    Please note that this .ZIP file contains a collection of other files, all of which are compressed.  If you're running WindowsXP or later, you can right-click on the the file (once you've downloaded it), and select "Extract All", and Windows will extract the contents of the .ZIP file for you. If you're running an older verison of windows, you may need a program such as 7Zip (http://www.7-zip.org/), PowerArchiver (http://www.powerarchiver.com/), or WinZip (http://www.winzip.com/) in order to open the file. If you're using a different operating system, you should find a tool that will extract .ZIP files appropriate for your platform.
     
  3. Install the JDK and JDK documentation
    (This step has already been done for you on the computers at Cascadia)

    Once you’ve downloaded the above two items, you should install them on your hard drive.  I’d accept whatever defaults the JDK suggests in terms of location, etc.  Put the documentation into a subdirectory (subfolder) of the JDK, and name that directory (folder) something like “docs”.

  4. Download the development environment: jGrasp
    (This step has already been done for you on the computers at Cascadia)
    (If you have the version of the textbook published by Thompson publishing, you will find this software on a CD-ROM at the back of the book)

    Technically, you can develop Java programs using nothing more than the JDK, Notepad, and a command prompt.  However, this can be tricky, so we’ll be using an Integrated Development Environment (IDE) to let us focus on writing Java, not on making the JDK do what we want.

    We’ll be using the jGrasp IDE during class, and I’d recommend that you use the same software at home, as well. You can download a free version from:

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

    Again, getting a version that is newer than Cascadia's shouldn't hurt.  You should download the version that's appropriate for your operating system (for Windows, the top-most button, labeled jGRASP.exe, is what you want)

    Once you’ve downloaded the IDE, you should then install it.  It may need to be told where your JDK is (which you’ve already installed, right?).

    For Advanced Students Only: You’re free to use any other IDE that you want – Eclipse has gotten good reviews (http://www.eclipse.org), and is widely used in industry.  The NetBeans project is also a solid choice (http://www.netbeans.org).
    If you choose to use anything other than jGRASP, you’re on your own if you run into problems.  While I’ll try and offer help, I won’t really be able to guarantee anything.  I can't guarantee that I'll be able to fix any problems you have at home, with jGRASP, either, but I do know more about jGrasp, and so can probably be of more help :) .
     
  5. Download the Robot software
    (This step is specific to BIT 115 - if you're in anything else, you don't have to do this step)
    You’ll need some custom software in order to actually write programs that use the Java-based “Karel The Robot”.  This version of the software was created by Byron Weber Becker, at the University of Waterloo in Canada.  You'll need the following three files.  Here at school, I would recommend placing them in your personal folders, which should be mapped to the H: drive letter.  Further, I'd create a folder named BIT115, and within that, create a folder named Robot, and move all three files that you downloaded in step 5 there.  At this point, you'd don't need to un-ZIP the Robot documentation or examples, although you should feel free to look through them on your own, if you're curious.
    You may have to download the files by RIGHT-clicking on each link, and selecting Save Target As from the pop-up menu that appears.

    • The .JAR file containing all the robots, etc: becker.jar

      If you don't download this file and install it correctly, NONE OF YOUR PROGRAMS WILL WORK!!  Please see the Lecture 1 tutorial for more details on install this file so that jGrasp will know how to find it.
       
  6. Configure jGrasp for home use

     

                If you're working on your own computer at home, you _have_ do this step.  It's also listed in the In Class Exercises for Lecture 1, just so you don't forget! 
                During the 2009 Spring term, you may also need to do this for the computers at school, as well.

     

                In addition to the functionality that standard Java gives us, we're going to use some custom software that will simulate robots.  This software is found in the named becker.jar, which you downloaded when you installed all the other software.  (JAR is short for Java ARchive, by the way.) 

     

                However, before you can write Java programs that use this, you need to tell JGrasp where to find the file.  You do this by seting the classpath to make JGrasp locate becker.jar  NONE OF YOUR PROGRAMS WILL WORK UNTIL YOU DO THIS.  However, you will only need to do this ONCE – just the first time that you start JGrasp on a given machine.

               

    To set the classpath, open the Settings menu and select the PATH / CLASSPATH option, and then finally the Workspace menu item (see Figure 4.)  You will see a dialog window that resembles Figure 5. First click on the CLASSPATHS tab (not merely the PATHS tab), and then click the New button, and you'll see another dialog window that resembles Figure 6.  Click on the button labeled Browse, and find the Becker.jar file that you've downloaded.  Becker.jar contains all of the custom software that we'll need to simulate our robots. You may also add the documentation here, if you'd like, but you're not required to.  When you click OK, you should an entry in the window, which is circled in blue in the Figure 5, below. Click OK button (circled in pink) to get back to the main editor window.

     

    Figure 4

     

    Figure 5

     

     

    Figure 6

     

  7. Download a template for the first day
    For the first day, you'll use a template to get you started.  You will be expected to eventually be able to create an entire Java program from scratch (with no help from books, or your peers), but for the first day, you'll use a pre-written file to get you doing something interesting immediately.  You can download that file from:

    Starting_Template.java

    Please save this file into the BIT115 folder that you created in Step 5.  Make sure to keep the name of the file (Starting_Template.java) exactly  the same.

    Now you're ready to go on to the tutorial, where you'll start learning how to program!