Intellij Cannot resolve symbol on import

前端 未结 29 1852
耶瑟儿~
耶瑟儿~ 2020-11-30 18:10

This problem happens intermittently for different libraries and different projects. When trying to import a library, the package will be recognized, but the class name can\'

29条回答
  •  春和景丽
    2020-11-30 19:12

    I found the following answer from @jossef-harush and @matt-leidholm useful from another link

    • in IntelliJ editor, click on the red keyword (Integer for example) and press ALT + ENTER (or click the light bulb icon)
    • select Setup JDK from the intentions menu

    IntelliJ intentions menu

    • click on Configure

    Project SDK selection dialog

    • In my case, the JDK path was incorrect (pointed on /opt/jdk1.7.0_51 instead of /opt/jdk1.7.0_65)

    Broken Configure SDK dialog

    • click on the ... and browse to the right JDK path

    Fixed Configure SDK dialog

    • let's clear the cache

    IntelliJ File menu

提交回复
热议问题