在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

Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted

 

相关文章:

  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
猜你喜欢
  • 2021-07-14
  • 2021-12-19
  • 2022-12-23
  • 2021-07-10
  • 2021-08-03
  • 2022-12-23
相关资源
相似解决方案