scala 2.11报错error: not found: type Application
FROM: http://j-q-j.org/scala/scala-2-11-application-error.html
这两天学习scala,官网下载的最新版本2.11,书用的是《Programming in scala》,看到类和对象,这一章最后一段代码
|
1
2
3
4
5
|
import ChecksumAccumulator.calculateobject FallWinterSpringSummer extends Application { for (season <- List("fall", "winter", "spring")) println( season + ": " calculate(season))} |
scalac FallWinterSpringSummer.scala报错如下
|
1
|
error: not found: type Application |
查找scala官方api,发现内置了Application类的,不知道哪里出错了,书的示例代码照样编译出错。
百度搜索未果,FQgoogle好不容易才发现结果,最后发现stackoverflow大神的解释
Application has been deprecated from scala 2.9, probably it has been deleted in scala 2.11 (it still exists in scala 2.10) even though at the moment I can't find proofs for that, use App instead.
Proof found, this is the scala 2.11 branch on github which has only an App.scala and this is the 2.10which has App.scala and Application.scala with a deprecated warning.
scala 2.9以后的版本废弃了Application而是启用了App类,修正后代码如下
|
1
2
3
4
5
|
import ChecksumAccumulator.calculateobject FallWinterSpringSummer extends App { for (season <- List("fall", "winter", "spring")) println( season + ": " calculate(season))} |
还是不要赶时髦的好,乖乖下载个2.9继续搞。
scala 2.11报错error: not found: type Application的更多相关文章
- MySQL 8.0.11 报错[ERROR] [MY-011087] Different lower_case_table_names settings for server ('1')
--报错信息: 2018-06-07T19:52:26.943083+08:00 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld ...
- linux使用wkhtmltopdf报错error while loading shared libraries:
官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在li ...
- LR调试脚本的时候报错Error -27796:(已解决)
LR调试bbs脚本的时候报错: 1.Error -27796: Failed to connect to server "192.168.211.128:80": [10060] ...
- 发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store
发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store 昨晚上传项目到AppStore,报了这个错,纳尼! ...
- 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...
- inoic start projectname sidemenu报错 - Error: Cannot find module 'lodash._baseslice'
inoic start projectname sidemenu报错 - Error: Cannot find module 'lodash._baseslice' 在公司的电脑上出现过这个错误,后来 ...
- 运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such file or directory
运行编译后的程序报错 error while loading shared libraries: lib*.so: cannot open shared object file: No such f ...
- CentOS命令登录MySQL时,报错ERROR 1045 (28000):
CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解 ...
- android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037:
android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 问题原因: ...
随机推荐
- AC日记——统计和 洛谷 P2068
统计和 思路: 水题: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 100005 int n,m,tree ...
- 文本检查点web_reg_find和web_find两个函数的区别
LR脚本实战:文本检查点web_reg_find和web_find两个函数的区别 web_reg_find是先注册(register)后查找的:使用时将它放在请求语句的前面. 而web_find是 ...
- 山东BOSS性能压力测试
1. 概述 在山东BOSS性能压力测试过程中,发现脚本对于整个压力测试过程的重要性,一个压力测试脚本录制和编辑修改得怎么样直接影响后面压力测试的执行.通常情况下,脚本应尽可能的精简,就像写代码一样.针 ...
- LoadRunner中的C Vuser函数
LoadRunner中的C Vuser函数 事务函数: lr_end_sub_transaction 标记子事务的结束以便进行性能分析. lr_end_transaction 标记事务的结束. ...
- Aras Innovator 11 sp2 IE客户端设置
在上一篇文章<Aras Innovator 11 sp2 安装>后,服务器算是安装好了,还需要在使用的客户端进行设置才可以正常使用Aras Innovator 该篇为IE设置,还有< ...
- 论文笔记-RCNN
CAFFE玩了也有段时间了,现在开始准备研究一下物体检测,现在知道的有RCNN.spp-net.Fast-RCNN和Faster-RCNN,作为菜鸟我还是从头学习,决定先看RCNN,因为有项目要做还要 ...
- PHP文件包含小结
协议 各种协议的使用有时是关键 file协议 file后面需是///,例如file:///d:/1.txt 也可以是file://e:/1.txt,如果是在当前盘则可以file:///1.txt 如果 ...
- CodeForces 734E Anton and Tree
$dfs$缩点,树形$dp$. 首先将连通块缩点,缩点后形成一个黑白节点相间的树.接下来的任务就是寻找一个$root$,使这棵树以$root$为根,树的高度是最小的(也就是一层一层染色).树形$dp$ ...
- Compass用法
一.什么是Compass? Compass是Sass的工具库,Compass在SASS的基础上,封装了一系列有用的模块去补充Sass的功能,类似Javascript和jQuery 二.安装 之前已经写 ...
- 【UOJ #131】【NOI 2015】品酒大会
http://uoj.ac/problem/131 求出后缀数组和height数组后,从大到小扫相似度进行合并,每次相当于合并两个紧挨着的区间. 合并区间可以用并查集来实现,每个区间的信息都记录在这个 ...