Scala Error: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class
准备给scala项目引入单元测试
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<version>2.2.6</version>
</dependency>
Scala版本: 2.10.4
编译的时候遇到了下面的错误:
Error:scalac: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class
一开始猜错是scalatest的版本不对,换了几个版本都还是遇到一样的错误,认真阅读错误信息后恍然大悟!
应该是编译环境的版本不对,我原来安装的scala版本是2.10.4,升级到1.11.7后没有这个错误了,但却出现了另外一个错误:
can't expand macros compiled by previous versions of Scala
意思应该是说不能展开以前版本scala编译的宏
把相应的scalatest编译的版本升级一下:scalatest_2.10 -> scalatest_2.11
最终的配置:
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>2.2.6</version>
<scope>test</scope>
</dependency>
Scala版本: 2.11.7
用2.11.7版本的scala编译没有问题了,但是在提交到spark运行的过程中发现有错误,我的spark用的是官方的基于scala2.10.4编译的2.5.1。
java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;
如果想要要用2.11.7版本的scala来编译你的spark app的话
在服务器上就必须自己用对应版本scala重新编译spark!!!
为了偷懒继续折腾~
把scala SDK降级到2.10.6,并把scalatest降级到相应的版本
最最终的配置:
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<version>2.2.6</version>
<scope>test</scope>
</dependency>
Scala版本: 2.10.6
最后,终于可以正常编译和运行scalatest了,并且编译的二进制可以在spark上运行起来了。
Scala Error: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class的更多相关文章
- IDEA里运行代码时出现Error:scalac: error while loading JUnit4, Scala signature JUnit4 has wrong version  expected: 5.0  found: 4.1 in JUnit4.class错误的解决办法(图文详解)
		
不多说,直接上干货! 问题详情 当出现这类错误时是由于版本不匹配造成的 Information:// : - Compilation completed with errors and warnin ...
 - Selenium2学习-041-chromedriver:org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unexpected alert open
		
今天在写WebDriver处理弹出框(alert.confirm.prompt)演示实例脚本分发给朋友时,在其执行时未能成功执行,对应的部分错误详情如下: org.openqa.selenium.We ...
 - IDEA里运行程序时出现Error:scalac:error while loading JUnit4 , Scala signature JUnit4 has wrong version错误的解决办法(图文详解)
		
不多说,直接上干货! 问题详情 当我们在运行程序时,出现Error:scalac:error while loading JUnit4 , Scala signature JUnit4 has wro ...
 - [ERROR] error: error while loading <root>, error in opening zip file error: scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.
		
在家编译一个Apache的开源项目,在编译时遇到错误如下: error: error while loading <root>, error in opening zip file [ER ...
 - Scala Java Error: value filter is not a member of *
		
有时在Scala中调用Java的库,Java库会返回某些Java的集合或类型,必须经过一些转换才能正常使用. 否则有可能在编译的过程遇到这个错误. 错误字符串 下面是错误的主要信息. Scala Ja ...
 - idea 运行scala代码 报错:Exception in thread "main" java.lang.NoClassDefFoundError: scala/Predef$ java.lang.NoClassDefFoundError: scala/Function0 Error: A JNI error has occurred, please check your installati
		
各种报错信息如下: java.lang.NoClassDefFoundError: scala/Function0 at java.lang.Class.getDeclaredMethods0(Nat ...
 - Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
		
Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException reason:JDK与Scala的版本不 ...
 - 有关Error during sbt execution: No Scala version specified or detected的解决方案--SBT
		
sbt 全称为 Simple Build Tool,是 Scala 项目中的标准构建工具,类似于 Java 下的 Maven/Groovy 中的 Gradle. 项目的构建 项目依赖自动化管理 提供统 ...
 - Ubuntu14.04: Error found when loading /root/.profile
		
问题描述: 启用root账号登录后系统出现如下提示信息: Error found when loading /root/.profile stdin:is not a tty 解决方法: 在终端中用命 ...
 
随机推荐
- XSLT2.0实用的新功能 .(转)
			
转自:http://blog.csdn.net/crystalbruce/article/details/7407631 2007年1月,W3C发布了XSLT2.0规范,2009年发布了XSLT2.1 ...
 - 叉积判断 POJ1696
			
// 叉积判断 POJ1696 #include <iostream> #include <algorithm> #include <cstring> #inclu ...
 - c++ 概念及学习/c++ concept&learning(三)
			
这一篇继续说说程序设计中的基本语句:控制块 一 if类控制语句 if if else if , else if ,else if(条件语句){如果条件为真,要做的一些事情} if(条件语句) {如 ...
 - 瞬间从IT屌丝变大神——HTML规范
			
HTML规范包含以下内容: DTD统一用<!DOCTYPE HTML PUBLIC "_//W3C//DTD XHTML 1.0 Transitional//EN"" ...
 - [Hive -  LanguageManual]  VirtualColumns
			
Virtual Columns Simple Examples Virtual Columns Hive 0.8.0 provides support for two virtual columns: ...
 - HDU5734:Acperience(方差)
			
题意: 给出n个数xi,确定一个值α,使得Σ(xi-α)^2的值最小. 分析: 可以猜想是方差,不懂得可以去方差了解一下. 那么α即为∑(xi)/n,然后要注意的是转化为分数,首先我们不能用小数转分数 ...
 - Cognos 增加全局类
			
Cognos使用版本10.1.1 由于我服务器装的是linux系统下的,所以window系统下的方法,提一下,但是没有实现过. 1.Linux系统下增加全局类 ●修改GlobalReportStyle ...
 - UVALive 7457	Discrete Logarithm Problem (暴力枚举)
			
Discrete Logarithm Problem 题目链接: http://acm.hust.edu.cn/vjudge/contest/127401#problem/D Description ...
 - POJ 1062 昂贵的聘礼 (最短路)
			
昂贵的聘礼 题目链接: http://acm.hust.edu.cn/vjudge/contest/122685#problem/M Description 年轻的探险家来到了一个印第安部落里.在那里 ...
 - Linux vmstat:报告虚拟内存统计的工具
			
众所周知,计算机必须有称之为RAM(随机访问内存)的存储器使得计算机工作.RAM指的是插在计算机主板上的物理存储.这里的RAM被用于加载像浏览器.文字处理器这类的程序,实际上,你使用的程序都运行在内存 ...