The import *** cannot be resolved

Maven工程中编译时经常会提示The import *** cannot be resolved。

错误提示:

The import net.sf.json.JSONObject cannot be resolved。

原因分析:

Maven项目在编译的过程中,缺乏相应的jar包,可能是版本冲突,也可能是jar损坏,或者路径找不到。

解决方法:

下载相应的jar包,放到正确的路径下,如net.sf.json.JSONObject就是repository\net\sf\json。


jar包下载地址http://mvnrepository.com/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章