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.
    java jdk9 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,

jre project diagram
create a diagram for this module.
jre diagram

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 - module in jigsaw diagram
  • named modules (contain - libraries in jigsaw diagram JDKmodule
  • automatic modules - libraries in jigsaw diagram noJDKmodule

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.

jigsaw connection diagram

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.
    jigsaw diagram elements
  • You can view usages of the diagram element in the project files - select the desired element and press Ctrl+Alt+F7.
    jigsaw find usages
Last modified: 29 November 2017

See Also