PasswordUtility

For this lab I am providing the password generator logic as a Java Archive File. Instructions below show how to load a JAR file into Eclipse so that you can use it with your own GUI code.

Before beginning, you'll need to download the following two files (right-click, then Save As...):

  1. PasswordTester.java (an updated tester file to illustrate the use of the PasswordGenerator class)
  2. PasswordGenerator.jar (a Java ARchive file -- JAR -- containing the executable code for PasswordGenerator)

Once you've downloaded the above files, proceed as follows:

  1. Open Eclipse and create a new Java Project




  2. Find the PasswordTester.java file that you downloaded above in Windows Explorer (or Mac Finder) and drag it into the src folder of the project you created.




  3. The file will appear inside of the default package; however it will be marked with a red X, indicating that there are references in the file to user-defined classes that are not part of this project.




  4. In order to load the necessary file, select the project in the Eclipse explorer and then click Project:: Properties




  5. Select "Java Build Path" along the left, then the "Libraries" tab.



  6. Click "Add External JARs..."



  7. Find the jar file you've downloaded, then click "Open"



  8. PasswordGenerator.jar should now appear in the window section titled "JARs and class folders on the build path"



  9. Click OK to return to the Eclipse main window; the red X by PasswordTester.java should be gone, since it now recognizes the necessary files you've imported. At this point you can open PasswordTester.java and run it; then modify or use it as needed.



 

 

 

 

Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement