天天看點

解決IDEA中@Autowired抛紅問題問題解決

問題

在IDEA中通過

@Autowired

注入時在變量名下方一直有紅色的标記線進行提示

解決

  • 在IDEA中:File -> Settings 打開設定頁面
  • 搜尋

    inspections

    -> 搜尋

    autowiring

    ->

    Autowiring for Bean Class

    -> 将

    Error

    修改為

    Warning

    -> 點選

    OK

繼續閱讀