eclipse设置源级别 [英] eclipse set source level

查看:190
本文介绍了eclipse设置源级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个为jdk 7构建的项目,但我想扩展其对jdk 6用户的兼容性。我已经将编译器编译级别设置为1.6,但是项目正常编译,并且由于在java 7之前没有将方法revalidate添加到java中而无法在1.6 jre上运行(并且编译器没有给出任何警告关于这一点!)我怎样才能将源级别设置为1.6?我可以在netbeans中做到这一点,无论如何在eclipse中如何做到这一点?

I have a project that I built for jdk 7, but I want to expand its compatibility for jdk 6 users as well. I have set the compiler compilance level to 1.6, but the project compiles normally, and fails running on a 1.6 jre due to the fact that the method revalidate was not added to java until java 7. (and the compiler didn't give ANY warnings about this at all!) How can I set the source level to 1.6 as well? I could do this in netbeans, any way on how to do this in eclipse?

推荐答案

在项目属性 - > Java Build Path / Libraries选项卡中,确保您有JRE System Library 6 ennvironment

In project properties->Java Build Path/Libraries tab make sure you have JRE System Library 6 ennvironment

这篇关于eclipse设置源级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆