Defining an project internal lib folder in Eclipse

370 views Asked by At

Is there any way to define a project lib folder relative to a Java Project? (an project internal lib folder). There are some options to define external or absolute path libraries. I can also add each jar, but I found no way to define a internal lib folder, so any jar I add in this folder is added to the classpath (like a web library)

I changed the .classpath file manually, but this classpath entry <classpathentry kind="lib" path="lib" /> doesn't create a lib folder.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
    <classpathentry kind="lib" path="lib"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

You can also create a User Library and set the library's directory to be in the workspace, but then you'll have to change the user library for every new jar you add.

1

There are 1 answers

5
Paul Hicks On

Classpath entries in Eclipse are (mostly..) absolute references. There is no built-in support for this feature.

I've found a few pages with how-to style references, but so far, only one page that claims to have solved the problem.