Eclipse Updating the compiler compliance to 1.7

后端 未结 4 1973
广开言路
广开言路 2021-02-15 12:52

I am having some trouble updating the compiler compliance of my eclipse workspace (I am actually using RTC, but it is essentially eclipse). Currently, it uses a jdk of 1.6 so I

相关标签:
4条回答
  • 2021-02-15 13:30

    The Compiler compliance level is Version Dependent in eclipse. If you are using Eclipse 3.7 or lower then you won't get 1.7 compliance. Use Eclipse JUNO or higher.

    For more on JDT Core 7 and its release related information

    UPDATE:

    Even eclipse 3.7.1 version supports Java 7 features and compliance level.

    0 讨论(0)
  • 2021-02-15 13:37

    If you are using eclipse 3.7 then you add 1.7 into compliance level by following way:-

    • right click on project
    • click on Build path->Configure Build Path->project Facets
    • there you can see one link 'convert to faceted form'. click on it
    • mark java and select verion 1.7 from dropdown which is present in front of java tab
    • click on apply and click ok
    • now you can see that 1.7 version is appeared in compliance level

    Note:- Before above step you have to add JRE System library in Build path for jdk1.7

    0 讨论(0)
  • 2021-02-15 13:44

    Right click on project you have in use, click on Properties,

    enter image description here go on "Compiler compilance level", and select 1.8

    enter image description here

    0 讨论(0)
  • 2021-02-15 13:48

    I use eclipse 3.6.1 with installed JRE 1.7 and I was able to set Java compliance level to 1.7 (on the workspace level - preferences).
    In some workspaces I could do that right in the Preferences, in some workspaces I had to do that in a "hard way" updating several properties in the file: .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.core.prefs
    Here are changed lines: org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7

    Maybe it was just enough to change the line with "org.eclipse.jdt.core.compiler.compliance" property , but I did all three for the sake of completeness and consistency.

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