Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Intellij + Maven to import libraries: Cannot resolve symbol

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?

like image 710
abc32112 Avatar asked May 10 '14 10:05

abc32112


People also ask

Why is IntelliJ not importing Maven dependencies?

If the dependencies weren't imported correctly (IntelliJ IDEA highlights them), try to perform the following actions: You can check your local maven repository in the Maven | Repositories settings and try to update it. You can check the jar file of the local . m2 repository to see if it was downloaded correctly.


1 Answers

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?

like image 190
Software Engineer Avatar answered Nov 15 '22 11:11

Software Engineer