Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » subfolders - avoid expecting a package fragment
subfolders - avoid expecting a package fragment [message #21317] Tue, 13 May 2003 08:29 Go to next message
Eclipse UserFriend
Originally posted by: andreas.klotz.ais.fraunhofer.de

hi,

the file structure of my java-project has nested
folders of ONE package. eclipse expects the
subfolders to be a package fragment though
the package declaration defines the correct
package to which the class belongs.

does anyone know how to tell eclipse not
to expect subfolders as package fragments?

thanks,
andreas
Re: subfolders - avoid expecting a package fragment [message #21329 is a reply to message #21317] Tue, 13 May 2003 08:41 Go to previous messageGo to next message
Eclipse UserFriend
Andreas Klotz <andreas.klotz@ais.fraunhofer.de> wrote:
> the file structure of my java-project has nested
> folders of ONE package. eclipse expects the
> subfolders to be a package fragment though
> the package declaration defines the correct
> package to which the class belongs.
>
> does anyone know how to tell eclipse not
> to expect subfolders as package fragments?

I don't believe you can - but why do you want to arrange your source
that way anyway? Doesn't it make sense to arrange your source structure
to match your class structure?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Re: subfolders - avoid expecting a package fragment [message #21345 is a reply to message #21329] Tue, 13 May 2003 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.klotz.ais.fraunhofer.de

Jon Skeet wrote:

> I don't believe you can - but why do you want to arrange your source
> that way anyway? Doesn't it make sense to arrange your source structure
> to match your class structure?

Since we are working with some people on the project
we need to have a well organized file structer. And
because of inheritance we need to keep certain classes
in one package. that's what my partners told me.

andreas
Re: subfolders - avoid expecting a package fragment [message #21353 is a reply to message #21317] Tue, 13 May 2003 09:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Andreas Klotz wrote:

> hi,

> the file structure of my java-project has nested
> folders of ONE package. eclipse expects the
> subfolders to be a package fragment though
> the package declaration defines the correct
> package to which the class belongs.

> does anyone know how to tell eclipse not
> to expect subfolders as package fragments?

> thanks,
> andreas

Could you post an example of your file/package/class structure. Its not
clear what you mean by nested folders and package fragments.
Re: subfolders - avoid expecting a package fragment [message #21366 is a reply to message #21353] Tue, 13 May 2003 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.klotz.ais.fraunhofer.de

> Could you post an example of your file/package/class structure. Its not
> clear what you mean by nested folders and package fragments.

folder structure:

thisIs
|__my
|__fileStructure


thus eclipse expects this package structure
(and shows it like this in the package explorer):

thisIs
thisIs.my
thisIs.my.fileStructure


but the package structure is as declared
in the concerning classes:

thisIs
thisIs.my


classes contained in the folder 'fileStructure'
should be part of the package 'thisIs.my' as
declared in the classes. but eclipse thinks
classes contained in the folder 'fileStructure'
belong to the package 'thisIs.my.fileStructure'.


the sun java compiler does not make any trouble
because of this...

andreas
Re: subfolders - avoid expecting a package fragment [message #21398 is a reply to message #21366] Tue, 13 May 2003 10:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Andreas Klotz wrote:


> > Could you post an example of your file/package/class structure. Its not
> > clear what you mean by nested folders and package fragments.

> folder structure:

> thisIs
> |__my
> |__fileStructure


> thus eclipse expects this package structure
> (and shows it like this in the package explorer):

> thisIs
> thisIs.my
> thisIs.my.fileStructure


> but the package structure is as declared
> in the concerning classes:

> thisIs
> thisIs.my


> classes contained in the folder 'fileStructure'
> should be part of the package 'thisIs.my' as
> declared in the classes. but eclipse thinks
> classes contained in the folder 'fileStructure'
> belong to the package 'thisIs.my.fileStructure'.


> the sun java compiler does not make any trouble
> because of this...

> andreas



Files contained in folder 'fileStructure' should be contained in package
'thisIs.my.fileStructure'. If you want the classe to be in the 'thIs.my'
package, their source should be in the 'my' folder.

If you wish to keep the source in the 'fileStructure' folder separate from
the other source in the 'thIs.my' folder, you can create separate source
directories under your project. Something along the lines of:
Project
|-base
| |-thisIs
| |-my
|-fileStructure
|-thisIs
|-my

Make both base and fileStructure source folders
Re: subfolders - avoid expecting a package fragment [message #21586 is a reply to message #21345] Tue, 13 May 2003 12:41 Go to previous message
Eclipse UserFriend
Andreas Klotz <andreas.klotz@ais.fraunhofer.de> wrote:
> > I don't believe you can - but why do you want to arrange your source
> > that way anyway? Doesn't it make sense to arrange your source structure
> > to match your class structure?
>
> Since we are working with some people on the project
> we need to have a well organized file structer.

Sure - but if multiple copies of the hierarchy are needed, just have
multiple source roots, rather than deviating from the natural
hierarchy. Honestly, you're asking for trouble unless you follow the
conventions on this one - both in Eclipse and elsewhere.

> And because of inheritance we need to keep certain classes
> in one package. that's what my partners told me.

Hmm... usually it's better to just make things which are meant to be
accessed by child classes protected, but hey...

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Previous Topic:Organize Imports on a Package Basis
Next Topic:Eclipse CVS - Malformed Notify format
Goto Forum:
  


Current Time: Thu Jul 03 13:53:25 EDT 2025

Powered by FUDForum. Page generated in 0.04238 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top