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 ...
随机推荐
- 吴裕雄 python神经网络(6)
import randomimport numpy as npnp.random.randint(0,49,3) ##required libarariesimport tensorflow as t ...
- 内存占用过高 kill 调整mysql内存占用
通过 /var/log/messages 查看 被系统kill掉的进程 如果是自己崩溃会产生 hs_err_ 修改mysql my.cnf innodb_buffer_pool_siz ...
- linux 基本操作centos7
基于centos7 ,很多都跟6不同 Centos 7 firewall 命令: 查看已经开放的端口:firewall-cmd --list-ports 开启端口firewall-cmd --zon ...
- Shell 处理文件名中包含空格的文件
最近在学Gradle, 使用git clone 命令下载了一些资料,但是文件名含有空格,看上去不是很舒服,因此想到用shell脚本对其进行批处理,去掉文件名中的空格,注意这里是把所有的空格全去掉 gi ...
- springboot-day01-引入基础
1. 今日大纲 1. 了解Spring的发展 2. 掌握Spring的java配置方式 3. 学习Spring Boot 4. 使用Spring Boot完成CRUD 2. Spring的发展 2.1 ...
- putty颜色调整
右键window窗口--Changing Setting--window--Colours: * Default Foreground: 255/255/255 * Default Backgroun ...
- linux 根据服务名称批量杀死进程
ps -ef |grep python |awk '{print $2}'|xargs kill -9
- appium +ios 判断元素是否存在,排除visible=“false”的数据
问题 想要判断name=xxx的元素是否存在,存在的话进行点击,结果页面并没有展示我要的元素时也提示找到了元素 原因 ios通过driver.find_element_by_name(“name值 ...
- PHP 用正则获取URL的根域名
function GetUrlRoot($url){ preg_match('/[\w][\w-]*\.(?:com\.cn|com|cn|co|net|org|gov|cc|biz|info)(\/ ...
- PHP从规定字符中生成固定位数随即串
}