How to change workspace JRE in Eclipse

前端 未结 3 681
半阙折子戏
半阙折子戏 2020-12-16 04:52

While creating new Java project in Eclipse I got following warning \"The current workspace uses 1.4 JRE...\"
\"<

相关标签:
3条回答
  • 2020-12-16 05:03

    I also have jre7, and it really doesn't matter if it only says that is compliant with 1.6, because the project will look for the java compiler specified by the jre/jdk used in the project.

    I also recommend you use the jdk instead of the jre, and set the environment variable JAVA_HOME, there's lots of tutorials on this in Google.

    0 讨论(0)
  • 2020-12-16 05:07

    Java 7 support is only available since Eclipse Indigo SR1 (released about a month ago). So, upgrade Eclipse.

    0 讨论(0)
  • 2020-12-16 05:14

    The issue where it is compiling with 1.4 but the workspace Preferences Compiler setting is 1.6 seems to be the issue described in this bug:

    Bug 499675 - Global compiler settings ignored after restarting, defaults to 1.4 even though 1.8 displayed https://bugs.eclipse.org/bugs/show_bug.cgi?id=499675

    where the workaround is to change the workspace setting to a different version number and then back to 1.6. That would enable the workspace to compile with 1.6. To compile with 1.7 you'd need to upgrade eclipse as in BalusC's answer.

    0 讨论(0)
提交回复
热议问题