0

I am working on an android project and I want to import a library (that containts 3 jars) to my all existing project and new projects I make.
I want to add this lib using its RELATIVE PATH into my workspace (the folder in which the libraries are kept is inside my work space) OR make a folder and put those library files into that folder OR alternatively add this library using its RELATIVE PATH so if I move my workspace I don't have to resolve errors and dependencies for libraries and all that. Options so far I have tried.

1. Eclipse > Windows > Java > Build path > User libraries > New ..... Add Jars. will add files from an existing project (from a folder in that project) --- the problem is this option is that if I remove/delete project from harddrive It will delete the references to the libs.
2. Adding an environment variable (in java and in windows machine) and doing the steps above.
3. Right click in package explorer > Import > File system... to import the whole folder with a relative path from my workspace --- but it still requires a parent folder.

My directory structure is below..

H:\Android\workspace\libs
H:\Android\workspace\proj1
H:\Android\workspace\proj2
H:\Android\workspace\proj3
........

Add all the libs are to be kept in libs and as imported into projects like \libs\xyz1.jar \libs\xyz2.jar .....

I am using eclipse 4.3 kepler and Android ADT. I have also seen this link but its for eclipse 3.6. I would like to know if there is some a workaround to do or an additional feature in 4.3.

Community
  • 1
  • 1
johntheripp3r
  • 989
  • 6
  • 15

1 Answers1

0

In the source project:

Java > Build path > Project > Add

In the library project:

Java > Build path > Project > Order and Export > select Libraries to export

Daniel
  • 36,610
  • 3
  • 36
  • 69
  • I have already done that as mentioned previously. I want to add the library to all of the projects with a relative path from my workspace. – johntheripp3r Oct 19 '13 at 12:53