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 解决方法: 在终端中用命 ...
随机推荐
- C++实现离散余弦变换(参数为Eigen矩阵)
C++实现离散余弦变换(参数为Eigen矩阵) 问题描述 昨天写了一个参数为二维指针为参数的离散余弦变换,虽然改进了参数为二维数组时,当数组大小不确定时声明函数时带来的困难,但使用指针作为参数也存在一 ...
- select的option异常的总结
来源:http://www.ido321.com/1189.html 昨天,在项目中碰到了option显示异常的原因,截图如下: Firefox中用css控制之后效果 chrome和IE中css不奏效 ...
- Ubuntu中使用pyUSB读取鼠标或键盘的数据程序
参考 :http://www.orangecoat.com/how-to/read-and-decode-data-from-your-mouse-using-this-pyusb-hack 要注意的 ...
- BootStrap入门教程 (二) :BASE CSS(排版(Typography),表格(Table),表单(Forms),按钮(Buttons))
上讲回顾:Bootstrap的手脚架(Scaffolding)提供了固定(fixed)和流式(fluid)两种布局,它同时建立了一个宽达940px和12列的格网系统. 基于手脚架(Scaffoldin ...
- wine的中文字体显示
从1.1.4开始wine的界面就已经支持中文了,但是对于软件中的中文支持并不太好,主要原因.还是字体...Let's go 首先,copy一下字体:把simsun.ttc (即宋体)复制到 ~/.wi ...
- ffmpeg内置aac编码器正式发布
https://www.ffmpeg.org/#aac_encoder_stable February 15th, 2016, FFmpeg 3.0 "Einstein" FFmp ...
- labview多个并行循环同时退出
labview中停止并行的循环 问题: 在labview中我如何停止两个并行的循环?我使用一个局部变量,但是当我停止程序执行后,第二次不能运行程序.我该如何解决这个问题呢? 解答: 你使用局部变量来 ...
- jquery easyui鼠标右击显示自定义的菜单
1.datagrid表格中,对某一行鼠标右击,显示出如下的自定义的菜单: 在html页面中写: <div id="menu" class="easyui-menu& ...
- oracle merge用法
动机: 想在Oracle中用一条SQL语句直接进行Insert/Update的操作. 说明: 在进行SQL语句编写时,我们经常会遇到大量的同时进行Insert/Update的语句 ,也就是说当存在记录 ...
- 第三方类AFNetworking
1.AFNetworking简介 AFNetworking是一个在iOS开发中使用非常多的轻量级网络开源库适用于iOS以及Mac OS X.它构建于在(Apple iOS开发文档) NSURLConn ...