Community
Participate
Working Groups
Documentation to IClasspathEntry ( http://help.eclipse.org/help21/topic/org.eclipse.jdt.doc.isv/reference/api/org/e clipse/jdt/core/IClasspathEntry.html ) mentions possibility to use a folder with class files external to the workspace. But this does not work. The Build Path configuration dialog allows only picking folders from workspace, but I have tried adding entry <classpathentry kind="lib" path="/C:/test/classes"/> directly to .classpath file in my project. The build path was considered OK, but the classes from the folder were not available on the project classpath. The interesting thing is, that when I specified a non-existing folder, I got a build path error and the project did not compile at all. Same behavior observed in both E2.1 and E3.0M8. Note: "Setting the Java build path" ( http://help.eclipse.org/help21/topic/org.eclipse.jdt.doc.isv/guide/jdt_api_class path.htm ) mentions that the class file folder should be inside the workspace only, which is a conflict with the documentation mentioned above.
You should not edit the .classpath yourself. Go to the project properties>Java Build Path>Libraries>Add Class Folder>Create New Folder...>Advanced> In the folder name, you put the name you want to see in the project. You check "Link to folder on the file system" and then you browse to the directory you want. Click OK until you close the dialog. This should work.
I see, so I must link the external folder into the workspace. However that means that the documentation in IClasspathEntry is not right. I found this problem because I actually did this thing programatically (which now turns out to require two steps - linking the folder and then adding it to the classpath). And second point is that the build path processor in fact considers the external folders somehow - as I wrote, it was checking whether the folder exists or not and did not produce any warning about that it is not supported (or that it is not a jar file). And sorry for touching the .classpath file directly, that was just for testing :-)
Jerome - pls make change to spec to clarify this situation.
Clarified the spec to say that a binary folder must be internal to the workspace, or that it must be first linked using IFolder#createLink(...) if it is external.
*** Bug 59987 has been marked as a duplicate of this bug. ***
Verified in 200405180816. Clarifications have been added inside javaCore.newLibraryFolder(...).