idea automatically removes imported but unused packages

In the process of using idea development, usually we may introduce a certain package to use, but this package will not be needed in subsequent changes! It is very troublesome to remove one by one. The shortcut key to remove each java file is ctrl+shift+o. If you want a smarter method, we can do the following configuration: 1.
Use ctrl+alt+s to enter the settings or as shown in the figure below Click File-settings in turn
insert image description here
2. Operate the steps 1, 2, and 3 as shown in the figure below, as marked in the figure below. If the removal does not take effect, just restart the idea and try it!
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44812604/article/details/127513509