使用Intellij + Maven导入库:无法解析符号 [英] Using Intellij + Maven to import libraries: Cannot resolve symbol

查看:1133
本文介绍了使用Intellij + Maven导入库:无法解析符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IntelliJ 13中使用Maven导入了一个库(JBox2D),用于android项目。 Maven没有给我任何错误消息,所以我认为库是正确导入的。

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.

但是,一旦我尝试使用库中的类,我就会得到无法解析符号。 IntelliJ不像往常那样提供添加import语句的选项。

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.

我该怎么办?

推荐答案

打开maven窗口并点击重新导入按钮(它通常是工具栏上的第一个按钮)。这将迫使IntelliJ根据您的pom中的更改重新导入您的项目。

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.

此外,检查IntelliJ中的maven设置,并确认您已配置为在IntelliJ中使用与在命令行上使用相同的maven。

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.

如果这不起作用,那么请尝试更详细地解释一下您使用maven导入库的意思?

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

这篇关于使用Intellij + Maven导入库:无法解析符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆