Programming in Java Spring 2006

Installing and Testing Java SDK

Due Date: 1/28/06
Submit via WebCT drop box labeled HW1

Assignment

This assignment is simply to install Java SDK 5.0 and get things working on your computer. If you have access to a computer with Java already intalled, feel free to use that computer (we don't care if you know how to install Java, just that you have a usable Java development environment available to you). Once you have Java installed, you need to make some simple additions to the program shown below, compile and run the program. You will need to submit your source code (the file Hw1.java that you have modified) and the output of the program when you run it on your machine.

Installing Java:



  Starting Code for HW1
/**
 * Title: Hw1
 * Description: Homework #1 Class Definition
 * @author joestudent@rpi.edu
 * @version 1.0
 */

public class Hw1 {

    /**
     * The main() simply calls ShowInfo.
     */
    public static void main(String[] args) {
        ShowInfo();
    }

    /**
     * ShowInfo does all the work by calling System.getProperty
     */
    public static void ShowInfo() {
        System.out.println("Version: " + System.getProperty("java.version"));

        /* In addition to the above statement, this program should
           print out the following:
           operating system name
           virtual machine name
           user name
           user's current working directory

	   HINT: Look at the documentation for System.getProperty()
	*/
    }
}




How to submit

Log in to WebCT at webct.rpi.edu using your RCS id and password. Once you get to MyWebCT click on "Programming in Java", and from there go to the homework drop boxes. Submit your files (individually, zipped, tarred or a jar file) to the drop box labeled HW1

Don't send compiled code (class files)!