Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala异常NoClassDefFoundError:eclipse中的Scala.util.parsing.json.JSONObject_Json_Scala - Fatal编程技术网

Scala异常NoClassDefFoundError:eclipse中的Scala.util.parsing.json.JSONObject

Scala异常NoClassDefFoundError:eclipse中的Scala.util.parsing.json.JSONObject,json,scala,Json,Scala,在我的Scala程序(在Eclipse IDE中)中,我导入了JSONObject,如下所示: import scala.util.parsing.json.JSONObject 当我试图运行它抛出的程序时:由以下原因引起:java.lang.ClassNotFoundException:scala.util.parsing.json.JSONObject 但当我运行mvn clean install时,它可以编译得非常好。 所以我想也许日食中有什么把戏,有什么想法吗!提前谢谢 Eclipse

在我的Scala程序(在Eclipse IDE中)中,我导入了JSONObject,如下所示:

import scala.util.parsing.json.JSONObject
当我试图运行它抛出的程序时:由以下原因引起:java.lang.ClassNotFoundException:scala.util.parsing.json.JSONObject

但当我运行mvn clean install时,它可以编译得非常好。
所以我想也许日食中有什么把戏,有什么想法吗!提前谢谢

Eclipse有时会给Scala带来问题。试试这个- 转到eclipse工具栏。 进入项目。 取消选中“自动生成”。 再次进入项目。 选择buildall。(它将强制建设该项目)


再次转到project并检查“自动生成”。

尝试刷新eclipse项目。尝试清理生成eclipse项目