发布项目到tomcat中时,编译的class文件与.java文件一起发布了

开发中遇到的问题,发布项目到tomcat中时,编译的class文件与.java文件一起发布了,如下图


解决方案:

打开原项目,找到.classpath文件,右键选择相应的程序打开。如下图所示


问题出在圈住的地方。

修改为:

<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>

然后刷新eclipse中的项目,删除原来部署的tomcat的项目,重新部署就可以了!

修改后的文件为

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_5_CONTAINER"/>
	<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.cross.easystruts.eclipse.STRUTS13_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/antlr.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-beanutils.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-digester.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-fileupload.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-javaflow-20060411.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-lang.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-logging.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-validator.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dwr.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/iTextAsian.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ireport.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jakarta-oro.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jcommon-1.0.10.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jdom_1_0.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jfreechart-1.0.6-experimental.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jfreechart-1.0.6-swt.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jfreechart-1.0.6.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/junit.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/proxool-0.9.1.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/proxool-cglib.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/servlet.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/shtools2009.6.13.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/struts.jar"/>
	<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/swtgraphics2d.jar"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_43"/>
	<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>

猜你喜欢

转载自blog.csdn.net/niuzaiwenjie/article/details/80859113