最近因为工作需要需要维护用myeclipse开发的项目,因为自己懒得装myeclipse于是百度找资料,可怜资料大多数不全,前篇一律,好在自己摸索着把问题解决了,于是乎自己整理出来以供后人需要。
首先eclipse中导入myeclipse项目后右键close project,然后在工作空间中找到该项目下面的.project文件,添加如下配置:
在 <natures> </natures>中加入 <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
在 <buildSpec> </buildSpec>中加入
<buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments>
</arguments>
</buildCommand>
<buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments>
</arguments>
</buildCommand>
在修改.setting文件夹下的
.jsdtscope和org.eclipse.wst.common.component文件
修改.jsdtscope文件为:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<!--将WebContent 改成WebRoot-->
<classpathentry kind="src" path="WebRoot"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
修改.org.eclipse.wst.common.component文件为:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="blog">
<wb-resource deploy-path="/" source-path="/WebRoot"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="blog"/>
<property name="java-output-path" value="/blog/WebRoot/WEB-INF/classes"/>
</wb-module>
</project-modules>
然后回到eclipse中重新打开项目,右键点击properties-->project Facts在右边选择
java,javascript,Daynamic Web Module三个选项,点击应用保存即可。
到此项目配置修改完成,此时在tomcat下就可以运行该项目了