Ctrl + Alt + O
打开settings:
然后Class类自动保存时就会自动清除
无用的import包。
IDEA 清除类中无用的import包
原文:https://www.cnblogs.com/gzhbk/p/14912453.html