1. Target runtime Apache Tomcat v6.0 is not defined.错误解决方法
原文:http://blog.csdn.net/xw13106209/article/details/5910358
解决方法:
方法是:在工程目录下的.settings文件夹里,打开org.eclipse.wst.common.project.facet.core.xml文件,其内容是:
<?xmlversion="1.0"encoding="UTF-8"?>
<faceted-project>
<runtimename="Apache Tomcat v6.0"/>
<fixedfacet="jst.web"/>
<fixedfacet="jst.java"/>
<installedfacet="jst.java"version="6.0"/>
<installedfacet="jst.web"version="2.5"/>
<installedfacet="wst.jsdt.web"version="1.0"/>
</faceted-project>
将其修改为:
<?xml version="1.0" encoding="UTF-8" ?> <faceted-project> </faceted-project> 2. 依赖包的导出.classpath 文件,打开
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="var" path="M2_REPO/junit/junit/4.8.2/junit-4.8.2.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/C:/Users/wangwei1/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/aspectj/aspectjrt/1.6.11/aspectjrt-1.6.11.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/aspectj/aspectjweaver/1.6.11/aspectjweaver-1.6.11.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/cglib/cglib/2.2.2/cglib-2.2.2.jar" sourcepath="M2_REPO/cglib/cglib/2.2.2/cglib-2.2.2-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/C:/Users/wangwei1/.m2/repository/cglib/cglib/2.2.2/cglib-2.2.2-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="var" path="M2_REPO/asm/asm/3.3.1/asm-3.3.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
可以通过复制的方式加入依赖包。如加入:
<classpathentry exported="true" kind="var" path="M2_REPO/asm/asm/3.3.1/asm-3.3.1.jar"/>
拷贝进入新工程的.classpath文件即可