Intellij IDEA自动导入jar包

idea导入设置

一、步骤:

  1. 路径:File | Settings | Editor | General | Auto Import
  2. 勾选:√
    √ Add unambiguous imports on the fly ?
    √ Optimize imports on the fly ?

二、作用:

  1. 不同名包:自动导入、
  2. 无用包:自动去掉没用包
  3. 同名包:需要手动 Alt + Enter 进行导入

猜你喜欢

转载自blog.csdn.net/qq_25482375/article/details/124015565