Why UML diagrams do not show dependencies
I'm using IDEA to write a Java project. After finishing, I want to see the project's UML class diagram. I use the default UML support and enable all checkboxes under "Java Class", like screenshot below:

Then I open the diagram, but there's only two sizes of lines: blue lines show the inheritance relation between classes, and green lines show the implementation of interface. There's no dependencies (like usages), which should be white lines. I have enable the "show dependencies" button on the diagram toolbar, but nothing changes.

In fact the project do have many dependencies, like class BooksetFactory will create instances of class Other, OtherA, OtherS...I think these relations should have be shown in the diagram according to the UML convention.
So what happens? Is there a bug?
Please sign in to leave a comment.
Can't reproduce. Can you share a sample "Hello World" project where it could be reproduced?
See also https://youtrack.jetbrains.com/issue/IDEA-177758
Konstantin Annikov
Has create a sample project with 3 java classes. In general:
In Mainclass.java:
public class Mainclass {public static void main(String[] argv) {
Example1 exp1 = new Example1("Create a Example class 1 from Mainclass");
exp1.f1("Mainclass");
exp1.callf2();
}
}
In Example1.java:
public class Example1 {
private String attr;
public Example1(String str) {
System.out.println(str);
this.attr = str;
}
public void f1(String s) {
System.out.println("f1 called from " + s);
}
public void callf2() {
Example2 exp2 = new Example2("ttt");
exp2.f2("example class 1");
}
}
In Example2.java:
public class Example2 {
public Example2(String str) {
System.out.println(str);
}
public void f2(String s) {
System.out.println("f2 called from " + s);
}
}
Code screenshot as follows:
But UML diagram as follows:
No dependency at all. It does not show the <<create>> dependencies between Mainclass and Example1, or between Example1 and Example2. It also doesn't show the usage in which Example1 calls Example2's method.
UML diagram shows dependencies of 1 class only. You need to add other classes (Right-click on diagram | Add class to diagram).
Here is the usability problem about that: https://youtrack.jetbrains.com/issue/IDEA-81834
Konstantin Annikov
Sorry but still can not understand. When I open the diagram of 1 class (like Mainclass above) and manually add other classes (Example1, Example2) by right-click, there's still no dependencies.
I find some UML diagrams created by other people using IDEA on the internet. I circle some lines in one diagram below; What I really want to know is, how can these white lines (showing dependencies, assocation, aggregation etc.) automatically generated in the diagram?
(this diagram is found in https://zhuanlan.zhihu.com/p/175122754)
Here is the video how to achieve that: https://youtu.be/hAgVxfDKoGw
Konstantin Annikov
Thank's for your attention. I've repeat what you do in the video, but still cannot show dependencies.
My video is here: https://youtu.be/PeGmfUW0X7k
What is the version of IntelliJ IDEA?
As a general troubleshooting step, please:
1. Reproduce the issue in a brand new Java project (without Maven/Gradle etc)
2. Disable all custom plugins: https://www.jetbrains.com/help/idea/managing-plugins.html#disable-plugin
3. Reset settings to default via File | Manage IDE Settings | Restore Default Settings
Konstantin Annikov
The version copied from "Help -> About" menu:
Seems that the problem lies in your official Chinese(Simplified) Language Pack plugin (version 203.596). I reset the IDE settings and enable that plugin and the dependencies still cannot be shown; but after I disable it and restart IDE, the bug disappears.
It's ok for me to use a pure English interface, however still hope to have a fix as soon as possible. You can report it to your plugin team.
This has been fixed already in EAP version of IntelliJ IDEA:
https://youtrack.jetbrains.com/issue/IDEA-256254
I can't either, it's not fixed yet
Runtime version: 11.0.13+7-b1751.25 amd64
Chinese (Simplified) Language Pack / 中文语言包
Version 223.143
2652127675 Please check if the problem reproduces in the latest build from https://www.jetbrains.com/idea/download . If the problem remains contact JetBrains support at https://intellij-support.jetbrains.com/hc/en-us/requests/new and provide a couple of screenshots showing your problem. Thank you!
Hi, I downloaded the ultimate Version for students today and came across the same problem. It is strange that nothing occur after I clicking the show dependencies button. Already reported the problem to your suggested link, hope to see how it goes soon.