0

I was wondering whether it is possible to create a package tree in eclipse Neon while creating a new class.

For instance, I want to create a class HelloWorld which is to be in a package .hello under a following hierarchy it.univaq.disim.soa.hello. When I try to create it I get a result as shown in the image.

I tried different views in project/package presentation.., no success.

screenshot

greg-449
  • 109,219
  • 232
  • 102
  • 145
bakke2ooo
  • 1
  • 2
  • not clear what's wrong with your result. Do you just want to see the parent packages? That's usually a setting in eclipse. – Taylor Oct 13 '16 at 15:03
  • Sorry, I might have not explained it properly. So, when I create a new java class, and I want it to be in the it.univaq.disim.soa.hello package hierarchy under a src package, write a package name (the string divided by dots), as it is shown, I do not get a packet hierarchy but a single packet named as the string I entered. – bakke2ooo Oct 13 '16 at 15:15
  • You are getting the package hierarchy correctly, it is just that Eclipse is showing it using the 'flatten' style to save space. The answer in the duplicate shows how to change this style. – greg-449 Oct 13 '16 at 15:28
  • Dear @greg-449, thank you for your quick response, but as I mentioned above, I did try to change both project and package presentation from flat to hierarchical, and it did not solve my issue. My problem is not the presentation, but rather the real package structure i.e., how to create it while creating a java class. Meanwhile I tried to create it manually - adding another package one after another, and that is quite a mess itself... – bakke2ooo Oct 13 '16 at 15:37
  • Sorry, but the picture of the package explorer tree and your code look correct. Edit you question and add more details of what you are seeing and why you think it is wrong. – greg-449 Oct 13 '16 at 15:48
  • Dear @greg-449, I think I got it. At least the project should work this way as well. I guess I was expecting to see all packages cascading even if most of the higher level ones did not contain any classes. Thanks again and sorry for bother. – bakke2ooo Oct 13 '16 at 16:50

0 Answers0