8

In IntelliJ IDEA, the "Project" pane on the left has "View as:", with the following options:

  • Project
  • Packages
  • Scope
  • Favorites

If you select "Project" it shows something like Eclipse's "Package Explorer", however if you choose "Packages" and you followed following convention:

  • src
    • main
      • java
      • org
        • ...
      • resources
    • test
      • java
      • org
        • ...
      • resources

it displays a view that merges the "main" and "test" folders, thus showing you the unit tests next to their associate classes (the classes they test). This is quite handy IMO, is there a way to do this in Eclipse (3.7.2)?

Thanks!

2

2 Answers 2

4

This is the way to do it:

Triangle icon -> Package Presentation -> Hierarchial

Note that IntelliJ and AndroidStudio use Gradle style folders, that is src/main... and eclipse doesn't yet support Gradle and uses the older style.

Eclipse screenshot

2
  • Sorry for the delay :-). Thanks for the answer but this is not really what I meant. IDEA merges the main and test view, so you end up with the test classes next to the classes they test (only visually of course).
    – Gabriel
    Mar 21, 2016 at 9:15
  • No worries man, sorry for my late response, fell asleep. Didn't even know that that was an option in IDEA, good to know!
    – Squeazer
    Apr 17, 2020 at 17:21
0

Screenshots would help for those of us completely unfamiliar with IntelliJ. Have you tried the Java Browsing Perspective and its Projects and Packages Views?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.