RBI
RBI

Reputation: 833

Using external JARs on eclipse when working between Windows and Mac

I have my java projects setup on Dropbox, including the external libraries that I use in those projects. the problem is that the jar files, when included in the build configuration of the project, are statically linked and the path to the Dropbox folder where the jars are located are different between OS's. This means that every time I go to work on the project from a different OS, I have to delete the paths and reconfigure them for the current OS.

Is there a better way to link this within eclipse so that I don't have to do this?

Thanks!

Upvotes: 0

Views: 111

Answers (2)

RBI
RBI

Reputation: 833

OK here's what did it for me:

  1. copy the JAR(s) to the project directory (or a sub-directory).
  2. In eclipse, refresh the project and navigate to the JAR(s) in the "Package Explorer" window
  3. select/right-click the JAR(s) and press "Add to Build Path"

this will copy the JAR(s) to the build path from which they are referenced relative to the project directory

Upvotes: 1

benzonico
benzonico

Reputation: 10833

You can try to use Linked Resources : Go to Preferences -> General -> Workspace -> LinkedResources : there you can specify a variable containing the path to your Dropbox folder and then use this variable to configure your paths.

You will need to configure this variable in your two environments.

Upvotes: 1

Related Questions