views:

1872

answers:

3

I'm trying to add two folders to my eclipse project's classpath, let's say Folder A and Folder B. B is inside A. Whenever I add A to the classpath

<classpathentry kind="lib" path="/A"/>

it works just fine, but I need to be able to access the files in B as well. Whenever I try to add

<classpathentry kind="lib" path="/A/B"/>

to the classpath, it says

Cannot nest 'A/B inside library A'

I'm a newbie when it comes to editing the classpath, so I'm wondering, is there is anyway to add a folder in the eclipse classpath that is nested in another folder that is also in the eclipse classpath?

+5  A: 

I don't think you can (or should be) allowed to do that, and it's not really an Eclipse issue AFAIK

Any individual classpath is a root under which the JVM starts looking for classes using the standard package notation

So let's say that your program has a class X in the default package, and a b.X class in the b package. If the default package root is /a, then your package b would be in /a/b

If you had one classpath root pointing to /a and one classpath root pointing to /a/b, and now you asked for class X, then one could interpret your request as X in the default package (since there is a root at A), but also as class X in the default package relative to the path /a/b, but that is the class b.X

So to prevent these things from happening, you're not allowed to have classpath roots that are nested.

Uri
A: 

That perfectly makes sense for folders containing java classes. But I do have two nested folders which contain only non java files. I want all these files in my project class path. Adding the parent folder alone does not help, as the files are non, java. What shoud I do?

I am trying to add the folders using the Add External Class Folder option in Eclipse build path configuration window. (Ganymede)

A: 

Can or can't show me a result