How to instruct Eclipse to record relative paths of the external jars?

Here is my .classpath file, after I have added two more external jars (org.restlet.ext.simple.jar and org.simpleframework.jar):

<?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.6"/>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.restlet.ext.jackson.jar" sourcepath="C:/Program Files/Java/restlet-jse-2.0.10/src">
        <attributes>
            <attribute name="javadoc_location" value="file:/C:/Program Files/Java/restlet-jse-2.0.10/docs/ext/"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.restlet.ext.ssl.jar" sourcepath="C:/Program Files/Java/restlet-jse-2.0.10/src">
        <attributes>
            <attribute name="javadoc_location" value="file:/C:/Program Files/Java/restlet-jse-2.0.10/docs/ext/"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.restlet.jar" sourcepath="C:/Program Files/Java/restlet-jse-2.0.10/src">
        <attributes>
            <attribute name="javadoc_location" value="file:/C:/Program Files/Java/restlet-jse-2.0.10/docs/api"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.jsslutils_1.0/org.jsslutils.jar"/>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.codehaus.jackson_1.4/org.codehaus.jackson.core.jar"/>
    <classpathentry kind="lib" path="../3rd_party/restlet-jse-2.0.10/lib/org.codehaus.jackson_1.4/org.codehaus.jackson.mapper.jar"/>
    <classpathentry kind="lib" path="../3rd_party/guice-3.0/aopalliance.jar"/>
    <classpathentry kind="lib" path="../3rd_party/guice-3.0/guice-3.0.jar"/>
    <classpathentry kind="lib" path="../3rd_party/guice-3.0/javax.inject.jar"/>
    <classpathentry kind="lib" path="C:/dev/poc/3rd_party/restlet-jse-2.0.10/lib/org.restlet.ext.simple.jar" sourcepath="C:/Program Files/Java/restlet-jse-2.0.10/src">
        <attributes>
            <attribute name="javadoc_location" value="file:/C:/Program Files/Java/restlet-jse-2.0.10/docs/ext/"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="C:/dev/poc/3rd_party/restlet-jse-2.0.10/lib/org.simpleframework_4.1/org.simpleframework.jar"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

Notice that they have been added with absolute paths, unlike other entries which are with relative ones, but only because I manually edit this file each time new external jars are added.

My question is can I somehow tell Eclipse to use relative paths of newly added external jars?

Thanks.

Answers


One solution is to not use external jars, but to put your jars into a project, and then use Add Jar(s) instead of Add External Jar(s).

This makes sense from the point of view of source control, you can add/remove dependencies as you need them. It also means that when you update one jar for a separate project, it'll not affect this one.

We've done this in the past, we had a single project which contained all of the jars, which were referred to in the build paths of other projects.

But now we use maven, so we don't need to do that any more.


Need Your Help

PHP mysql fixed connection to utf8, but now existing greek data is useless

php mysql character-encoding

I have a mysql database storing some fields in greek characters. In my html I have charset=utf-8 and my database columns are defined with encoding utf_general_ci. But I was not setting the connect...

Displaying Error Message from C# AfterInstall Event

c# windows installer

Can someone please tell me how to display error message in C# during execution of AfterInstallEvent?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.