Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted
在java中写switch代码时,参数用的是string,jdk用的是1.8,但是还是报错,说不支持1.7版本以下的,然后查找了项目中的一些文件,打开一个文件如下,发现是1.6的版本,好奇怪啊,按照eclipse提示,将版本换成1.7的,就可以了。


Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted的更多相关文章
- android switch(String)错误:Cannot switch on a value of type String for source level below 1.7
switch语句的判断条件可以接受int,byte,char,short,不能接受其他类型只有JDK版本1.7以上才可以支持String 设置如下可解决问题:(若没有JDK1.7版,可下载一下安装)菜 ...
- The type String cannot be constructed. You must configure the container to supply this value.
利用 Enterprise Library 5.0 Microsoft.Practices.EnterpriseLibrary.Common Microsoft.Practices.Enterpris ...
- swift2.0 Cannot assign a value of type '[CFString]' to a value of type '[String]'
Cannot assign a value of type '[CFString]' to a value of type '[String]' 代码示例如下: picker.mediaTypes = ...
- go语言byte类型报错cannot use "c" (type string) as type byte in assignment
练习Go修改字符串的时候遇到这个问题:cannot use "c" (type string) as type byte in assignment,代码如下: package m ...
- 解决 'Could not convert variant of type (NULL) into type (String)
写存储过程中有不允许为空的字段,在客户端转化取数时显示 Could not convert variant of type (NULL) into type (String) 可以在存储过程中使用is ...
- 无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“System.Collections.Generic.List<Ecology.Model.EnergyFlowGraph>”
无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“Sy ...
- Switch选择语句能否作用在String【字符串】上,也就是能否这么写:Switch(一个字符串变量)?
Switch选择语句能否作用在String[字符串]上,也就是能否这么写:Switch(一个字符串变量)? 解答:不可以,只能处理int,byte,short,char,(其实是只能处理int,其它三 ...
- mongolass 中报 ($.content: "say Hi ~") ✖ (type: String)
第二次报这个错了, 一直以为MongoDB的模型用的type 是 String, 一直报错, 找不到原因. // 留言模型1 exports.Comment = mongolass.model('Co ...
- (type interface {}) to type string
go 语言开发中,经常会在函数中碰到使用 insterface{} 作为接收任意参数,但是我们接收的数据经常是需要做类型转换,由于是初学者,因此,初次转换我是直接就 func New(paramete ...
随机推荐
- setting 常用配置
一,保存logging 信息 # 保存log信息的文件名 LOG_LEVEL = "INFO" LOG_STDOUT = True LOG_ENCODING = 'utf-8' # ...
- 阿里云栖大会 所有ppt
https://github.com/Alimei/hangzhouYunQi2017ppt
- vue 组件中this指向
今天开始学习慕课网的“去哪网”app开发,之前用学了一段时间对vue还是没有深刻理解透,先在开始要从新开始学习vue,今天学的第一堂课是vue 中v-model.v-for的简单例子,以前改变dom中 ...
- CentOS7 安装 GitLab
虽然GitHub已经很好了,但是我们必须联上公网才可以使用并且如果不付费的话,你的代码在网上就是公开的!但是在企业环境中,我们公司的代码不希望被公开并且也不想付费给GitHub,这时怎么办呢?我们可以 ...
- sql 2012的补丁 SP4下载地址
https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=56040
- spring boot IDEA 开发微服务(二)
https://www.cnblogs.com/spaceud/p/8097934.html 参考以上微博,自己实际操作步骤如下: 1~开发准备 JDK:1.8 Spring Boot:2.1.0 S ...
- django搭建的站点,通过localhost能访问,但是通过ip不能访问
问题:使用ip访问不了django站点,只能用127.0.0.1访问 解决方法:启动服务时ip使用0.0.0.0 使用gunicorn启动 gunicorn -w4 -b0.0.0.0:8 ...
- 八:python 对象类型详解四:字典
一:字典通识: 1,字典通过键而不是偏移量来读取: 2,字典是任意对象的无序集合: 3,字典可变长.异构.任意嵌套: 4,字典属于可变映射类型: 5,对象引用表(散列表): 二:实际应用中的字典: 1 ...
- php项目执行composer install时报错
报错信息: Loading composer repositories with package informationInstalling dependencies (including requi ...
- 十个前端UI优秀框架
最近需要一些前端框架,于是在网上整理了一些感觉不错的前端框架,有pc端和移动端,为了方便日后自己先记录下来了... Bootstrap 首先说 Bootstrap,估计你也猜到会先说或者一定会有这个( ...