Target JRE in Eclipse

后端 未结 6 890
独厮守ぢ
独厮守ぢ 2020-12-18 12:15

How should I change Target JRE in Eclipse. I was earlier using jdk1.7, now I want to use JDK 1.6. But while running my java program I am getting Unsupported Class Version Er

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-18 12:54

    Sometimes I had troubles with the Eclipse preferences, so if nothing seems to help anymore I try the following.

    Switch to the Navigator view, open your project and the .settings folder. Check for the following files and check/update the following settings (depending on the project type there might be different files). I just opened a maven web project.

    file org.eclipse.jdt.core.prefs:

    org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
    org.eclipse.jdt.core.compiler.compliance=1.6
    org.eclipse.jdt.core.compiler.source=1.6
    

    file org.eclipse.wst.common.project.facet.core.xml:

    
    
       
       ...
     
    

    file .classpath (in app root, not .settings directory)

    
    

    Basicly you can search for 1.7 and 7.0 in the enclosing project, to check/update the settings.

提交回复
热议问题