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

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

Description	Resource	Path	Location	Type
Incompatible .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 runtime	Capital-Plugins28		Build path	Build 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=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱的叹息

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值