Search code examples
windowseclipseubuntupathbuildpath

Cross Platform java development with Eclipse (Build Path issues)


I have 3 partitions (and the required one that Windows will generate). One contains Windows, one contains Ubuntu, I also have a ntfs partition named Data that contains my Development folder that I use as storage between the two environments.

So in Windows it is located at: D:\Development*

In Ubuntu it is located at: /media/Data/Development/*

Whenever I set up my environment, everything is great as far as the source files, but whenever it gets to the point of the build path, it is expecting the absolute path from the previous platform I was working with (so swapping to Windows from Ubuntu it is expecting things located at /media/Data/Development/* and when switching to Ubuntu from Windows it is expecting it in D:\Development*).

Is there a way to use relative paths such that if I open the project in Windows or Ubuntu it doesn't require modification of the build path?


Solution

  • Place the libraries jar files under a lib directory in your Eclipse project, and use a project-relative path (using "Add jars" rather than "Add external jars") to include these libraries in the build path.