问题详情
当我们在运行程序时,出现Error:scalac:error while loading JUnit4 , Scala signature JUnit4 has wrong version,见下图。
原因所在
是版本冲突吧 ,juint的这个包 你用的是什么 ,一般都用 3.8.x吧
在Scala IDEA for Eclipse里也是如此,
解决办法
将上述改为如下
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
同时,你若项目里没用到这两个时,将先暂时将其注释掉,因为它这两个是用到了JUnit4。(我用的这种方法,就解决了)
成功!