Intellij IDEA使用教程相关系列 目录


在IDEA编译器里,spring项目中使用@Autowired注解,出现private field 'xxx' is never assigned警告

IDEA 出现问题:出现private field ‘xxx‘ is never assigned警告解决方案_ide

解决方案:

  1. 在变量上单击使光标在变量上.

  2. 按Alt+Enter快捷键,显示

    IDEA 出现问题:出现private field ‘xxx‘ is never assigned警告解决方案_spring_02

     

  3. 上下键选中回车或者鼠标单击途中高亮的那个选项即可.