The objective of this lab is to create a deployable application as a set of one or more JAR files.
In this part of the assignment, you are to write a simple application (using Eclipse) consisting of two classes. The names of the classes are up to you, but both classes must be declared in a package name that is your MSOE email name. The main class should just create an instance of the second class and call a public method of that class (that method's declaration is up to you). That method must create an instance of the WinPlotter class and use the created object to display some kind of output using the moveTo and drawTo methods.
The WinPlotter class, along with several private other classes that WinPlotter uses, are packaged in a winPlotter.jar file along with the JavaDoc that describe how you can use its public methods. This means that you'll have to modify your Eclipse project's build settings to add winPlotter.jar to your project as an external JAR.
Before moving on to the following section, it is suggested that you modify your PATH environment variable to include the location of your Java JDK's bin directory, so that you can issue commands like java and jar without having to specify the full path to the associated executable files.
Once you have created and validated your application, create a Lab8.jar file containing the two .class files that comprise your application along with a Manifest. You can use this sample Manifest file and modify it as needed. In addition to the Manifest-Version, Created-By, and Main-Class tags, the Manifest must contain a fourth Class-Path tag that specifies the relative location of the winPlotter.jar file with respect to the Lab8.jar file itself. This is needed because your application needs to locate the winPlotter.jar file when it executes. This was not discussed in lecture, but you can read about setting the Class-Path tag at http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html.
Following the lecture slides, run your application by issuing the appropriate command from a Console window. Once you get the syntax correct, incorporate the command into a Desktop shortcut that you can use to launch the application.
When you are done, demonstrate this to your instructor. The demonstration counts for 25% of your grade.
In this part of the assignment, you are to write an ANT build-script that will automatically compile your .java files and build the Lab8.jar file. You can use this sample build script and modify it as needed. This file is heavily commented and contains instructions on how to modify it and execute it. Note: There is actually very little you have to modify within this file, but be sure to read through the file carefully. There is no need to understand everything about ANT in order to do this, so don't think you have to wade through the entire ANT manual before beginning.
To execute the build script, you'll need to download and install the Apache ANT build tool. Installing Ant is easy; however, you need to add/modify a few environment variables in order to get it to run. See the "Windows and OS/2" section in the installation instructions page at http://ant.apache.org/manual/index.html.
You must demonstrate running the ANT script to build your Lab8.jar file in lab next week, which counts for another 25% of your grade. You may demonstrate it earlier if you can.
Follow the lab submission instructions and include the following items in your submission:
- Your .java files.
- Your Lab8.jar file.
- Your desktop shortcut file.
- The ANT build script.
See the lab submission instructions for information on how your lab will be graded.