How can I make a child package inside a package in eclipse project explorer?
I already tried..
com.proj.test
then I create a new package
com.proj.test.child
to add a child package at package
com.proj.test
,
but did not succeed
How can I make a child package inside a package in eclipse project explorer?
I already tried..
com.proj.test
then I create a new package
com.proj.test.child
to add a child package at package
com.proj.test
,
but did not succeed
To enable hierarchical visualization in the eclipse package explorer do these following steps:
In The Package Explorer View / View Menu (An arrow pointing down on top right) Go to Package Presentation and set type to Hierarchical.
What you did is correct, I assume you are using 'Project explorer' view, switch to hierarchical view to see content as child-parent : Window->Show View->Navigator
Right click on the package com.proj.test
, new -> package and then write com.proj.test.child
for the name.
I tried it just now and it works well.
When you select "New Package" off the eclipse menu, the corresponding folder(s) will also be created automatically.
You don't have to define sub-packages one level at a time.
If You define a new package and enter the package name
com.coder.javapackage.innerone.etc
any missing elements in that package tree will also be created automatically.
This is just visual representation on the package. In reality they can sit in two different jars, but you should not be concerned about it, because jvm and loader internally handle that.
I gave up on trying to reason with Eclipse as it seemed to completely ignore my hierarchal package representation setting, plus it was ignoring packages for some reason and refusing to compile as a result… I just made the folder hierarchy myself in Finder then imported it into Eclipse. That fixed everything.
In Project Explorer perspective View Menu -> Package Presentation -> Hierarchical . I hope it helps.
I was able to change the "Package Presentation" option, which by default has the option "Flat" to "Hierarchical". This option is present in button "View menu", on "Project Explorer" perspective.
First create the parent package and then press the right click on the parent package select new package where you see new window will appear then write new package name beside the parent package with dot. Ex- test (this is parent package called test) test.model (this is child package called model) like this you can on and on to make more package like - test.model.modelOne Hope this will help someone.
Right click on package parent and write complete name of child package is OK. But then to have a good graphical representation, you have to add a file in this child package... It's just refresh IHM (if you look folders of project, they already exist before this refresh). Eclipse does not refresh enough project window...
If your project under "Project explorer" view then change it to "Navigator" . As follows
Window->Show View->Navigator
By doing this you will able to see packages as parent child hierarchy.