6

Is there a way to create user library in eclipse using class path variable to add relative path jars to the library

john miran
  • 393
  • 2
  • 13

2 Answers2

2

It's easy. Don't use User Libraries. Instead, use Variables. Example from my workspace:

Open image in a new tab to see full size

Open image in a new tab to see full size

Further reference: Here and there

Community
  • 1
  • 1
Georgian
  • 8,795
  • 8
  • 46
  • 87
  • 1
    I know that , but what if you have a large number of jars , and some jars must be grouped logically? can i understand that's not possible to do the same thing using user library. – john miran Aug 18 '13 at 22:40
  • 1
    Well then just add a variable that points to the folder which contains all those jars. I think that also works. – Georgian Aug 18 '13 at 22:40
  • :) funny answer. what does it mean "don't use" ? :) there is there the benefit to use USER_LIBS. the answer is NO WAY :) – magulla Oct 13 '16 at 20:13
  • @magulla I'm sorry, I don't really understand your argument – Georgian Oct 14 '16 at 08:06
  • 1
    @GGrec, I'm sorry, but look, I'm not sure if you gave this answer just to get points or tried to help. But in fact this example of not useful answer, for some even miss leading. Because: 1. It doesn't answer the question, "if it is possible to use vars in eclipse USER LIB concept" 2. IMHO: if you decide to add dependency on IDE in java project (though not good) instead of keep it IDE neutral using ant/maven/gradle.., then at least try to do in clean way - using USER LIB is clean way. You hint - is not, it make Eclipse show many unuseful info in project view. – magulla Oct 17 '16 at 15:21
0

The approach suggested by GGrec is functional and I used it. But "User Libraries" allow some sort of grouping/structuring, for example "Jersey", or "Hibernate", etc. I found an alternative way to get it working: Created the simplest Eclipse Project. Then inside it created "Linked Resource" Folder using an Eclipse Path Variable. Now I can create the necessary "User Libraries" and "Add JARs" to them, using this Linked resource folder. In case the location of the jars is changed, the only thing that should be altered is the Eclipse Path Variable, pointing to them. May be this approach can help someone else.

Ebeneezer
  • 89
  • 5