Idea设置自动导包 【File】→【Setting】(或使用快捷键【Crlt + Shift + S】)打开Setting设置。 点击【Editor】→【General】→【Auto Import】。勾选自定导包的选项,并确定,如下: