Problems with package name
Hi
I'm having problem with my package name.
As a remainder of a recent project I have a directory which simplyfied looks like this:
myApp/src/java/com/abc/test
and the package name set in each class under this directory is
com.abc.test
And if I, beneath Source tab (Java Build Path properties form) put myApp/src/java in source folders list, eclipse complains about package name not being as expected (java.com.abc.test vs. com.abc.test). And if I put myApp/src/java/com in the source folders list, eclipse gives me the following:
Cannot nest 'myApp/src/java' inside library 'myApp/src'.
I can see one solution, which is to remove the java directory and place the packages directly underneath the src folder, but I wonder if there is another way of doing this.
And by the way, the reason the second complaint is there is because the myApp/src is found in the Libraries tab (beneath Web App Libraries) and can't be removed by some reason.
Anyone?
/R
Re: Problems with package name
Hi,
I was having the same problem because I wanted to have "src/main/java" and "src/main/resources" rather than just "src". This is how I solved it:
- Removed "Web App Libraries" from "Libraries" tab
- Exited Eclipse
- Went to project directory and found the file ".settings/org.eclipse.wst.common.component". This file contained <wb-resource> elements for all three source folders (src, src/main/java, and src/main/resources).
- Deleted <wb-resource> line with source-path="/src".
- Started Eclipse
- Added "Web App Libraries" back.
Probably it's not the right way for fixing the problem but it worked for me.
Hope this helps,
Andrey