1.打開設定 idea設定自動清除不需要的import包,自動清除導包 idea設定自動清除不需要的import包,自動清除導包 2. idea設定自動清除不需要的import包,自動清除導包 勾選上即可。