简体   繁体   English

当我迁移到1.7时,Eclipse认为我的JRE是1.6

[英]Eclipse thinks my JRE is 1.6, when I've migrated to 1.7

I am having a problem with Eclipse Luna after an update. 更新后, Eclipse Luna出现问题。 Despite showing in the tree for the project that it is using JRE system library 1.7 the error checking is reporting bugs with a switch using a string that it has a source level below 1.7 . 尽管在项目树中显示它正在使用JRE system library 1.7但错误检查仍使用源级别低于1.7的字符串通过开关报告错误。

The specific error: 具体错误:

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

I have tried going into Properties > Build Path and adding and removing the library but this has not fixed the problem. 我尝试进入“ Properties > Build Path并添加和删除库,但这不能解决问题。

I moved from the Eclipse packaged with Debain Wheezy which uses the 1.6 JDK and the much older Eclipse 3.8 . 我从与Debain Wheezy打包在一起的Eclipse移出,后者使用1.6 JDK和更老的Eclipse 3.8 I am now using CentOS 7 with the 1.7 JDK . 我现在将CentOS 71.7 JDK The migration has not been as smooth as I hoped. 迁移并不像我希望的那样顺利。 Since there has some big version jumps, I need help getting this new 4.4 version working properly. 由于存在一些较大的版本跳转,因此我需要帮助以使此新的4.4版本正常运行。

Window -> Preferences -> Java Compiler -> set the compiler level to 1.7 窗口->首选项-> Java编译器->将编译器级别设置为1.7

Same for Project -> Properties -> Java Compiler -> 1.7 与Project-> Properties-> Java Compiler-> 1.7相同

If you can't find that option (by which I mean Compiler 1.7 ), you must specify the Installed JRE to be JDK 7 too. 如果找不到该选项(我的意思是Compiler 1.7 ),则也必须将Installed JRE也指定为JDK 7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM