Reputation: 3010
I added an external jar file into my eclipse project from the properties>libraries in my project. Then I export my project as a file system, to make runnable for every computer. However after I import to project in eclipse, jar file refers to the my computers path thats why it does not work.
How should I solve this ?
Thanks
Upvotes: 1
Views: 1045
Reputation: 5291
Define a class path variable and refer to the JAR using a variable in the class path of your project. Each programmer can then set the variable according to theirs environment. Variables can be set in Window -> Preferences -> Java -> Classpath Variables
and used by pressing Add Variable...
in Java Build Path editor of your project. When adding a variable to classpath, you can even press Extend...
and "extend" your variable with a suffix - i.e. have the variable contain a folder name and suffix it with a fixed file name.
Some more obvious options:
Upvotes: 2