Eclipse 3.5 added support for relative buildpath/classpath items, yet I cannot seem to find a graphical way to add relatively pathed items. The example in new and noteworthy (search the page for 'relative', about 40% of the way down) seems to indication I have to manually edit the .classpath file. Am I just missing something?
I think you can do this graphically instead of editing .classpath. Depending on Eclipse version it's something like:
Right-click project --> Properties --> Build Path --> Libraries (tab) --> Add Variable
Works in my current Eclipse with a Java project.. ;-)
As far as I know you currently can only achieve this by editing the .classpath file. For this to be possible through pure 'button pushing' the browse dialogs popping up after selecting 'Add External JARs...' and 'Add External Class Folder...' would need something like a check-box to specify if you want to add the relative or the absolute path. Maybe that is not hard to add, but I haven't seen it yet.
The actual way to do this is to import the library into your workspace so,
Right Click in Package Explorer -> Import -> File System -> Browse (to the directory containing your jars) -> check the boxes next to the jars you want -> Browse to the workspace folder you want to import to (probably your lib folder) -> Finish
Keep in mind this will copy the files into the lib folder so I've found that it helps keep things clean if you don't already have them in there. They will now show up in the package explorer under "lib." To add them to the classpath,
Right click on the project -> Build Path -> configure build path... -> Add JARs -> navigate to the given project's lib folder and select the appropriate JARs -> click ok -> click finish
This adds them to the CP with relative locations.
If you need more help let me know
After evaluating all responses and tinkering with Eclipse I can see no way to do this without manually editing the .classpath file.
Marking this answer as accepted to indicate that there is no way to do this in Eclipse 3.5. Keep fingers crossed for Eclipse 3.6 or Eclipse 4.
No. As of yet, it is not possible. But you will be seeing it soon. Keep checking the intergration builds.
This does not work!
Editing the .classpath to include relative paths as per the New and Noteworthy example (path="../../lib/myjar.jar") isn't difficult, however it does not appear to work as described!
It seems to resolve relative to the Workspace and not the specific Project as specified, which is not much use. Has anyone else found the same problem or a solution to this?
I've done this by adding the libraries to my project. So, create a folder under your project called "jars" and put all dependent jars in there.
When you configure the build path afterward, everything will be relative.