[program-java] Tutorial: User Library.

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: "Program - Java (Program-java@xxxxxxxxxxxxx)" <Program-java@xxxxxxxxxxxxx>
  • Date: Mon, 16 Sep 2013 16:11:43 +0000

It's been a while but here is yet another installment of my series on Eclipse.

Recently I have begun using my own library for simplifying the addition of 
commonly used external jars that are necessary for the particular type of 
project I am developing at the time.

It's relatively easy to create and implement into a project.

1.      Open Eclipse on a blank workspace and or project. You can use an 
existing project but for our purposes we will just use an empty one.
2.      Open the Windows/Preferences screen.
3.      Scroll down the treeview until you locate the Java node.
4.      Expand said node and locate Build Path.
5.      Once again expand that particular node and locate User Library.
6.      Press the TAB key twice to locate a list box titled Defined User 
7.      Locate the New button and press the enter key.
8.      A dialogue will appear asking you to enter the new library name. For my 
web based work, I've called it "WebProjects", for my desktop work I have one 
called "DeskTopProjects".
9.      Press the TAB key until you hear the "Ok" button and then press the 
enter key.
10.     If you have been successful, you are placed on the original screen as 
seen in step six.
11.     Locate the Add Jars button and press enter. A standard file dialogue 
will appear. It is from this dialogue where you select the jar files that are 
specific to your type of work.
12.     Once you have added the jars that you need, you can either select OK 
which will add the necessary files to the User Library for the given project 
you are working on, however you can't reuse the library outside of that 
project. You must Export your new User Library to a safe location so that it 
can be reused. I have my unique libraries stored in CVS but its completely up 
to you where it is saved.
13.     Now that we have a User Library, open your project.
14.     Right click the project name found in the project explorer view.
15.     A context menu will appear, scroll the menu until you locate Properties.
16.     A new screen with a treeview of various items will appear based upon 
the type of project you are developing. In most cases you will find the Java 
Build Path option.
17.     Once located, press the TAB key twice which will place you on a TAB 
18.     Locate the TAB titled Library.
19.     Press the TAB key a number of times until you locate the button titled 
Add Library.
20.     A new dialogue will appear with a list that contains the item User 
Library. Select same and then select the Next Button.
21.     If your User Library had been successfully created, you should see it 
as the first item in a new list. If it isn't selected, do so and then press the 
Ok button.
22.     Finally locate and select the OK button from the Properties screen.
You can verify the existence of your User Library by reviewing the project from 
the Project Explorer. It should appear as a folder at the SRC level.

I'm using Eclipse 3.6 for this example, so keep that in mind if you are 
attempting to create your own library in other versions.

(c) 2013 J. Corbett

Other related posts:

  • » [program-java] Tutorial: User Library. - Corbett, James