Using Intellij + Maven to import libraries: Cannot resolve symbol

回眸只為那壹抹淺笑 提交于 2020-01-11 06:03:07

问题


I have imported a library (JBox2D) using Maven in IntelliJ 13, for use in an android project. Maven didn't give me any error messages, so I assume the library was imported correctly.

However, as soon as I try use a class from the library, I get "Cannot resolve symbol". IntelliJ doesn't offer the option of adding an import statement, as it normally does.

How should I proceed?


回答1:


Open the maven window and hit the reimport button (it's usually the first one on the toolbar). This will force IntelliJ to reimport your project based on changes in your pom.

Also, check the maven settings within IntelliJ and confirm that you're configured to use the same maven in IntelliJ as you're using on the command line.

If this doesn't work, then try to explain in more detail what you mean by your having imported a library with maven?



来源:https://stackoverflow.com/questions/23579746/using-intellij-maven-to-import-libraries-cannot-resolve-symbol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!