之前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