Community
Participate
Working Groups
Source attachment for library based on classpath variable is missing a browse button like the normal source attachments.
jdt.core currently only supports the usage of variables in classpath variable entries
Martin, MG, I don't understand this bug report. In 3.1 M4 you can edit the source attachment of a library based on a classpath variable in the Java Build Path dialog. Can you clarify what is missing ?
I understood the request that for a variable class path entry they don't want the source attachments to be restricted to 'paths with variables' (say just a normal path like 'c:\xy\x.jar') I don't think we should do that, the point of variable entries is to not contain any platform specific paths, also not for the source attachments.
Yeah Martin is interpreting my request properly. I don't think the source should always be constrained to exist in the same place or even relative to the same place that the installed _variable_ dependant jar exists. I can still do what I want in the current version I just can't use the GUI to do it - meaning I can take a library which is located with a variable and then edit the .classpath file to have a sourcepath that does not include and is not relative to that variable.
I'm surprised that editing the .classpath file would work. Is this a new jdt.core feature? How is a variable path distinguished from a non-variable path?
Martin I don't remember we ever had the restriction that for a variable lib entry, the source attachment had to be a variable as well. Moving to JDT UI as there is no restriction in JDT Core.
It's in fact specified in IClasspathEntry.getSourceAttachmentPath(): For variable classpath entries, the * result path (if present) has an analogous form and meaning as the * variable path, namely the first segment is the name of a classpath variable. That's how I remember it and I think it makes sense as you can't distinguish a variable path from a normal path and otherwise thing get really messy (especially in the UI where we would end up with another 3 buttons (workspace path, ext. file path, ext. folder path) Variable entries have been designed to be shareable by not containing local file system paths, so having a platform specific path as source attachment is not such a good idea.
Martin is right, we cannot change this as this is clearly spec'ed. No action planned.