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.calculate object 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.calculate object 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: 问题原因: ...
随机推荐
- Go语言的基准测试简单示例
测试了三个从数字转换为字符的性能, 高手的感觉.... package listing28_test import ( "fmt" "testing" &quo ...
- Go语言基础单元测试示例
这个要熟悉原理,要能写.. 但现在..... 注意,没有main函数,以_test.go结尾,命令go test -v package main import ( "testing" ...
- Linux用户和用户组的初步知识
用户组相关:在Linux系统下,当创建一个如叫tom的用户,那么系统同时会创建一个叫tom的用户组linux中用户的信息都是放在/etc/passwd下的,用户的密码经过加密后放在/etc/shado ...
- 前端读者 | ES6知识点概述
本文来自 @羯瑞 整理 ES6,并不是一个新鲜的东西,ES7.ES8已经赶脚了.但是,东西不在于新,而在于总结. 变量的新定义 let 和 const 在ES6没有被普及时,我们会用的变量定义的方法是 ...
- CentOS7.5字体美化
背景知识 有衬线 (Serif) 无衬线 (Sans Serif) 和等宽 (Monospace) 字型 1 有衬线 (Serif) 字型是比较正式的字体,比划粗细不一,在笔划的边缘有装饰部分(我的理 ...
- SpringBoot学习:读取yml和properties文件的内容
一.在SpringBoot实现属性注入: 1).添加pom依赖jar包: <!-- 支持 @ConfigurationProperties 注解 --> <!-- https://m ...
- C# CreateProcess的测试
很奇怪的一个现象,在C#中使用Process来启动进程,启动文件名必须是系统指定的扩展名.EXE,而我使用原生的Win32API ::CreateProcess ()并没有这个限制,以后遇到类似的问题 ...
- mysql 如何给root用户设置密码
用root 进入mysql后mysql>set password =password('你的密码');mysql>flush privileges;
- 第2天:Ansible-Inventory管理
在Ansible中,将可管理的服务器集合成为Inventory.因此,Inventory管理便是服务器管理. hosts文件位置 我们知道,Ansible在执行操作时,首先需要确定对哪些服务器执行操作 ...
- Flask实战第43天:把图片验证码和短信验证码保存到memcached中
前面我们已经获取到图片验证码和短信验证码,但是我们还没有把它们保存起来.同样的,我们和之前的邮箱验证码一样,保存到memcached中 编辑commom.vews.py .. from utils i ...