Using Intellij + Maven to import libraries: Cannot resolve symbol
Asked Answered
B

1

6

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?

Brio answered 10/5, 2014 at 10:11 Comment(1)
E
19

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?

Echinoid answered 12/5, 2014 at 19:31 Comment(1)
I don't know why this doesn't have, like, a billion upvotes. Thank you so very very much.Frontispiece

© 2022 - 2024 — McMap. All rights reserved.