Lab 2 Preparation:

To sucessfully finish Lab 2 you will need to know some of the basics of using Eclipse. In particular, you will need to know how to create Eclipse projects and how to build Jar files.

Importing files:

1. Using the Eclipse File menu, create a new project. When prompted for the type, choose Java project. Otherwise, keep default options.

2. Create a new package in your project. This will be where you put your files.

3. Using the Eclipse File menu, choose Import. Then choose to import from the file system. Browse to the location where the Java files are that you want to import. Import the files into the new package that you completed.

4. If this is a working program, test it out by running as the main class.

Creating an executable jar file:

1. Use File, Export and select Jar file. Click Next.

2. Choose the resources to export (your source code) and specify a location and name for your Jar file. If you default on the name it is likely to write over something else! Click Next.

3. Select that you DO want to export files with compile warnings. Then click Next.

4. Select the class of the application entry point. VERY IMPORTANT. One of your classes is the top level one and has a main method.

5. Then, and ONLY then, choose Finish.

6. TEST YOUR JAR FILE by double-clicking on the file you just created. If it doesn't run, try again making sure you indicate that compilation warnings are ok and that you choose the correct class as the location for the main program. If your program opens any data files make sure they are in the correct position relative to your executable.