eclipse jdk版本设置
Unresolved compilation problems
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files
at TreesetDemo.main(TreesetDemo.java:12)
上述问题导致的原因是因为eclipse编译的时候使用jdk7版本,运行的时候使用jdk8版本。我意识到这个问题后我尝试去修改编译版本设置为jdk8,因为此时我的系统里面只有jdk8的版本。但是事与愿违,eclipse不支持1.8
然后我只能设置1.7了,下载了一个jdk1.7 zip包。这里我没有使用exe安装,因为我还是想保留1.8的。
操作步骤如下:
设置完成后可以看到jre版本,如下图。
大功告成!
本文介绍了如何解决Eclipse中因编译版本不一致导致的编译错误问题,并提供了将Eclipse编译版本从JDK 7更改为JDK 8的具体步骤。
3521

被折叠的 条评论
为什么被折叠?



