解决IDEA中@Autowired抛红问题

问题

在IDEA中通过@Autowired注入时在变量名下方一直有红色的标记线进行提示

解决

  • 在IDEA中:File -> Settings 打开设置页面
  • 搜索inspections -> 搜索autowiring -> Autowiring for Bean Class -> 将Error修改为Warning -> 点击OK

1563271187782

1563271341095

posted @ 2019-07-23 12:41  tiancixiong  阅读(21)  评论(0)    收藏  举报