CodeBlue
CodeBlue

Reputation: 15399

Where/How does Eclipse store user libraries?

I am working on a Java Project in Eclipse. I created a user library called "Spring" and added all the Spring jars to it. My question is, where does Eclipse store this library? Does it copy all the jars into a new directory somewhere on the disk? Or does it maintain information in some configuration file as to which jars belong to the user library?

Upvotes: 24

Views: 24426

Answers (2)

Qwertyzw
Qwertyzw

Reputation: 532

You can export them from the workspace where you created them, and import them into the workspace where you want them.

Old: Window -> preferences -> Java -> User Libraries -> import/export

New (not sure what eclipse version this change was introduced): Window -> preferences -> Java -> Build Path -> User Libraries -> import/export

If that's what you were trying to do (this is how I was led to this webpage)

Thanks @Jorn Vernee for the new version correction

Upvotes: 10

E-Riz
E-Riz

Reputation: 33034

Eclipse does not copy any of the contents of a User Library, it is merely a container with machine-specific absolute paths. The User Library definitions are stored in the workspace; specifically, in .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs.

The idea behind a User Library is that it is an abstraction above a collection of JARs that exist outside the project(s); each workspace must declare the contents for itself, since they are external to Eclipse projects.

Upvotes: 47

Related Questions