1、点击IDEA菜单栏的File列表项,在下拉的菜单列表中选中Settings选项。
3、右侧界面中勾选optimize imports on the fly(for current project)复选框,然后点击确定。