IDEA里运行代码时出现Error:scalac: error while loading JUnit4, Scala signature JUnit4 has wrong version expected: 5.0 found: 4.1 in JUnit4.class错误的解决办法(图文详解)
2017-08-29 07:59
806 查看
不多说,直接上干货!
[b] 问题详情[/b]
当出现这类错误时是由于版本不匹配造成的
解决办法
如果你想快速运行的话,就用idea建立的maven项目生成的几个test类和对象注释掉,或者删除掉即可运行。
然后,运行即可。
当然,上面的这种方法不是最彻底的。
File -> settings -> Editor -> plugins -> junit
[b] 问题详情[/b]
当出现这类错误时是由于版本不匹配造成的
Information:2017/8/29 7:54 - Compilation completed with 10 errors and 0 warnings in 3s 910ms Error:scalac: error while loading JUnit4, Scala signature JUnit4 has wrong version expected: 5.0 found: 4.1 in JUnit4.class Error:scalac: error while loading ConsoleRunner, Scala signature ConsoleRunner has wrong version expected: 5.0 found: 4.1 in ConsoleRunner.class Error:scalac: error while loading Specification, Scala signature Specification has wrong version expected: 5.0 found: 4.1 in Specification.class D:\Code\IntelliJIDEACode\HadoopSparkMllibAction\src\test\scala\zhouls\bigdata\MySpec.scala Error:(6, 26) illegal inheritance; self-type zhouls.bigdata.MySpecTest does not conform to org.specs.runner.JUnit4's selftype org.specs.runner.JUnit4 class MySpecTest extends JUnit4(MySpec) ^ Error:(6, 18) org.specs.runner.JUnit4 does not have a constructor class MySpecTest extends JUnit4(MySpec) ^ Error:(8, 29) illegal inheritance; self-type zhouls.bigdata.MySpecRunner.type does not conform to org.specs.runner.ConsoleRunner's selftype org.specs.runner.ConsoleRunner object MySpecRunner extends ConsoleRunner(MySpec) ^ Error:(8, 21) org.specs.runner.ConsoleRunner does not have a constructor object MySpecRunner extends ConsoleRunner(MySpec) ^ Error:(10, 23) illegal inheritance; self-type zhouls.bigdata.MySpec.type does not conform to org.specs.Specification's selftype org.specs.Specification object MySpec extends Specification { ^ Error:(10, 15) org.specs.Specification does not have a constructor object MySpec extends Specification { ^ Error:(11, 27) value should is not a member of String "This wonderful system" should { ^
解决办法
如果你想快速运行的话,就用idea建立的maven项目生成的几个test类和对象注释掉,或者删除掉即可运行。
然后,运行即可。
当然,上面的这种方法不是最彻底的。
File -> settings -> Editor -> plugins -> junit
相关文章推荐
- IDEA里运行代码时出现Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger的解决办法(图文详解)
- cloudera-scm-server启动出现Error creating bean with name 'entityManagerFactoryBean'与HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver错误解决办法(图文详解)
- 基于Web的Kafka管理器工具之Kafka-manager启动时出现Exception in thread "main" java.lang.UnsupportedClassVersionError错误解决办法(图文详解)
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- Win10运行正当防卫2(Just Cause 2),出现“DXGI_ERROR_NOT_FOUND”错误的解决办法。
- kafka启动时出现FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) java.io.IOException: Permission denied错误解决办法(图文详解)
- spark运行时出现Neither spark.yarn.jars nor spark.yarn.archive is set错误的解决办法(图文详解)
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- Android项目运行junit测试类时出现错误Internal Error (classFileParser.cpp:3494)的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法(1)
- IDEA13中配置struts错误:ClassNotFoundException: org...dispatcher.ng.filter.StrutsPrepareAndExecuteFilter +找不到java程序包 解决办法
- spark 程序在提交到集群上,出现ClassNoFound的错误,解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 运行JBoss 5.1.0 GA时出现Error installing to Instantiated:name=AttachmentStore state=Described错误的解决办法
- 安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
- 新建JSP无法运行出现错误The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Pat解决办法
- (转)安装mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法