更新时间:2022-10-14 23:13:58
您可以将整体工作区属性设置为使用一个版本的Java并设置单个项目属性另一个。
您可以从已安装的JRE中进行选择为任一设置。要告诉Eclipse有关新安装的JRE,您可以打开工作区首选项并导航到 Java > 安装的JRE ,然后点击添加按钮。
I am using Eclipse with JDK 1.7. My previous projects are developed in java 7 and JDK 1.7. Now, I want to build a new project under JDK 1.6 in Eclipse. Is it possible to do that so that some projects are based on JDK 1.7 and some others are based on JDK 1.6 without conflicts?
If this can be done, please let me know how to do it step by step.
Update: My default JDK is 1.7. I created a new project that is based on jdk1.7 by default. And then I go to the property of this project, and then java compiler, then change the compliance settings as the image shows below. But there is some error occurred. What could be the reason causes this error?
The following is the "problem" view
After some research, I have solved this problem. please see the reference about how to fix the facet version.
You can set overall workspace properties to use one version of Java and set individual project properties to use another.
You can choose from among the installed JREs for either setting. To tell Eclipse about a newly installed JRE, you can open the workspace preferences and navigate to Java > Installed JREs and then click the "Add" button.