简体   繁体   English

在eclipse上更改JRE时构建项目

[英]Building project when changing the JRE, on eclipse

I have a project that compiles and runs well with JRE6 , but when I changed to JRE7 I found many compilation problems. 我有一个用JRE6编译和运行的项目,但是当我改为JRE7我发现了很多编译问题。

I have re-changed the JRE on run configuration to JRE6 but the problem persists. 我已经将运行配置上的JRE重新更改为JRE6但问题仍然存在。

Here is an example: 这是一个例子:

public static class SaveInDBAction extends AbstractAction {
    public SaveInDBAction() {
    }
//staff
}

That class is defined on a file named EditorActions.java and the error was: 该类是在名为EditorActions.java的文件上定义的,错误是:

Illegal modifier of the class SaveInDBAction...

I tried to rebuild and even recopied the project to a new one but in vain, is there any suggestions? 我试图重建甚至将项目重新复制到一个新项目但是徒劳,有什么建议吗?

Here is a video that will help you to do what you want: 这是一个视频,可以帮助您做您想做的事情:
http://www.javavids.com/video/how-to-change-jre--jdk-in-eclipse-project.html http://www.javavids.com/video/how-to-change-jre--jdk-in-eclipse-project.html

The site states: 该网站指出:

Right click your project and choose properties. 右键单击您的项目并选择属性。 Select Java Build Path -> Libraries, select JRE System Library, click Edit and choose whichever JRE or JDK you like. 选择Java Build Path - > Libraries,选择JRE System Library,单击Edit并选择您喜欢的JRE或JDK。

Hope that solved it for you. 希望能为你解决它。

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

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