Project 'XX' is targeting a 1.6 runtime, but is compiled against '....

来源:互联网 发布:完美国际js是什么意思 编辑:程序博客网 时间:2024/05/21 08:52

之前eclipse会又不同程度的卡死,然后我就在进程中把强制杀死,可能因为这个原因吧,现在打开一些项目,报如下的错误:

DescriptionResourcePathLocationTypeIncompatible .class files version in required binaries. Project 'Capital-Plugins28' is targeting a 1.6 runtime, but is compiled against 'Capital-Plugins28/lib/capitalapi.jar' which requires a 1.7 runtimeCapital-Plugins28Build pathBuild Path Problem

提示的大概错误是:该像的jdk编译版本是1.6,而其中引用到的jar包需要JDk1.7的编译环境。

求解?

我目前的做法是:

由于项目必须要依赖那个jar包,所以需要把项目的编译jdk版本由1.6改为1.7:

具体操作如下:

1、先在eclipse中把该项目关闭,或者直接退出eclipse

2、在盘符下找到项目,进入项目的根目录

3、修改根目录下的“.project"这个文件,把下面的xml内容的加粗部分改为你实际的1.7的具体版本

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_06"><attributes><attribute name="owner.project.facets" value="java"/></attributes></classpathentry>
4、进入根目录/.settings,打开:org.eclipse.wst.common.project.facet.core.xml这个文件。把第一个加粗部分改为具体版本,第二个加粗改为1.7即可
<?xml version="1.0" encoding="UTF-8"?><faceted-project>  <runtime name="jdk1.7.0_06"/>  <installed facet="java" version="1.7"/></faceted-project>
5、进入根目录/.settings,打开:org.eclipse.jdt.core.prefs,把下面加粗的三个改为1.7即可。

eclipse.preferences.version=1org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabledorg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserveorg.eclipse.jdt.core.compiler.compliance=1.7org.eclipse.jdt.core.compiler.debug.lineNumber=generateorg.eclipse.jdt.core.compiler.debug.localVariable=generateorg.eclipse.jdt.core.compiler.debug.sourceFile=generateorg.eclipse.jdt.core.compiler.problem.assertIdentifier=errororg.eclipse.jdt.core.compiler.problem.enumIdentifier=errororg.eclipse.jdt.core.compiler.source=1.7




阅读全文
0 0
原创粉丝点击