IntelliJ IDEA 2017.2 Help

Working with Java module dependency diagrams

IntelliJ IDEA lets you view and manage diagrams for Java modules that are part of the Jigsaw project, which comes with JDK 9, so make sure you have the latest JDK 9 Early Access build installed to view and manage such diagrams.

Viewing a Java module diagram

  1. Open a project that contains Java modules.
    Note that IntelliJ IDEA allows only one Java module per one IntelliJ IDEA module.
  2. In the Projects tool window select an item (module/project) for which you want to create a diagram.
  3. Right-click the selected item and from the context menu select Diagram | Show Diagram. Alternatively, open the file in the editor and from the context menu select Show Diagram.
  4. From the list that opens, select the Java Module Diagram type. IntelliJ IDEA displays a diagram with modules and its dependencies.

You can also select a JDK module and using the context menu or pressing Ctrl+Shift+Alt+U,

create a diagram for this module.

Analyzing a Java module diagram

IntelliJ IDEA lets you view and analyze modules and its dependencies (named and automatic modules). You can easily recognize those modules since they each have a different color.

  • IntelliJ IDEA modules - /help/img/idea/2017.2/module_in_jigsaw_diagram.png
  • named modules (contain - /help/img/idea/2017.2/libraries_in_jigsaw_diagram_JDKmodule.png
  • automatic modules - /help/img/idea/2017.2/libraries_in_jigsaw_diagram_noJDKmodule.png

A connection between modules and dependencies is shown using arrows. With bold arrows IntelliJ IDEA displays a connection between modules and transitive dependencies. So you can always see what gets pulled in with the module.


Managing a Java module diagram

IntelliJ IDEA lets you manage your diagram performing basic diagram actions such as jumping to the source code, find usages, etc.

For more information, please see Diagram Reference, but check the following useful actions:

  • You can jump to the source code - select the desired item and press F4
  • You can quickly locate a module or a library if you have too many items in your graph - press Ctrl+F and from the list that opens, select the element you're looking for.
  • You can view usages of the diagram element in the project files - select the desired element and press Ctrl+Alt+F7.

See Also

Last modified: 16 August 2017