Home » Java » set relative path for jar file in .classpath file eclipse

set relative path for jar file in .classpath file eclipse

Posted by: admin June 30, 2018 Leave a comment

Questions:

I have created a customer jar in the parent folder of my java testng maven project.
After adding it as external jar, the absolute path is getting created in “.classpath” file.

Since multiple people are working on the same project, the absolute path would give an error. To resolve this issue, I want to create a relative path in “.classpath” file for the external jar file.

Have tried multiple options but none is working

Example:

<classpathentry kind="lib" path="./../common.jar"/>

or

<classpathentry kind="lib" path="../common.jar"/>

or

<classpathentry kind="lib" path="**/common.jar"/>

As multiple projects are going to use this custom jar have placed it in the parent folder.

Can anyone suggest how to create a relative path for the same?

Answers: