[eclipse-dev] Problem with top level package names, Java, and sourceforge
After getting some agreement that this was a problem I was recommended
to highlight this problem at a more general level (I was just in the
java devel list)
I have two closely inter-related (simple?) problems with packages and
CVS which seem to make Eclipse unsuable for me currently :-(
I had an existing package stucture in a directory d:\projects\swapdv The
classes in that directory have "package swapdv" as their first lines, as
I cannot work out how to get Eclipse to allow me to simply specify this
directory as my Java project and get the classpaths correct. All the top
level classes have this error: "Package declaration does not match
folder. Expected folder is "swapdv/swapdv". It appears you cannot have
the "project" folder be the "package" that the Java classes are in.
Can this be fixed? I worked around this problem by putting the swapdv
directory INTO a swapdv directory (e.g. now the package sources are in
d:\projects\swapdv\swapdv and the project is d:\projecys\swapdv)
That all sort-of worked (albeit with a workaround) but unfortunately I
*really* wanted to use the built in CVS functions to work with a
sourceforge project. So, starting from scratch, I specified the
sourceforge repository (/cvsroot/swapdv) and created a new project
"d:\projects\swapdv". Now I can ONLY manage to "catch up" (or sync
stream) if I specify the root of the project workspace (swapdv) (it
fails if I create an empty package called "swapdv" in that workspace and
try to sync that) and when it does sync with the workspace I've got all
the folders directly under the swapdv workspace folder - and Eclipse
doesn't like the package specifications again (see above).
Can anyone offer me any advice?
Well heres some stuff I've discovered after wasting another few hours on
Eclipse R1: You can solve the problem with a nasty trick: Create a
Simple project in d:\projects\swapdv\swapdv, check out the CVS
repository into that project Create a Java project in d:\projects\swapdv
and then sync the project with local contents - and voila - you have the
java packages and Eclipse doesn't complain about them. Use the Java
project to compile and run (I CANNOT debug at all in R1 - a dialog pops
up and vanishes before I can read it - any ideas?) Use the Simple
project to manage CVS stuff
Eclipse 2 (Jun2): You can't use the same hack as above because someone
has stopped projects containing projects. Thanks to that "improvement"
there is no work around I can see to the CVS sourceforge problem.