Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where/How does Eclipse store user libraries?

Tags:

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?

like image 401
CodeBlue Avatar asked May 29 '12 16:05

CodeBlue


People also ask

What are user Libraries in Eclipse?

Eclipse user library functionality helps you to save your time by selecting jar files one by one and add the jars into project build path. Suppose, you are developing Spring core based application and you have to add mainly four to five core jars of Spring framework in your project not the rest jars.

Where does Eclipse store settings?

1.2. Preferences are stored in the workspace of your application in the . metadata/. plugins/org. eclipse.

How do I view external Libraries in Eclipse?

Right-click this project folder, and select "Build Path", and then select "Configure Build Path..." Select "Java Build Path" on the left, and then the "Libraries" tab. Click the "Classpath" line, and then click the "Add External JARS..." button. Locate and select the "breadboards.


2 Answers

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.

like image 187
E-Riz Avatar answered Sep 19 '22 18:09

E-Riz


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

like image 40
Qwertyzw Avatar answered Sep 18 '22 18:09

Qwertyzw