MyEclipse Web项目导入到eclipse项目中

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36500554/article/details/75764657

最近在做项目测试,把MyEclipse项目,导入到eclipse里,遇到一些问题,总结如下:

1、进入项目目录,找到.project文件,打开。
增加一个<buildCommand>(如果有的话,就不用添加)

[java]  view plain  copy
  1. <buildCommand>  
  2. <span style="white-space:pre">    </span><name>org.eclipse.wst.validation.validationbuilder</name>  
  3.     <arguments>  
  4.     </arguments>  
  5. </buildCommand>  
2、找到<natures>…</natures>代码段。加入如下标签内容并保存:

[java]  view plain  copy
  1. <natures>  
  2.     <nature>org.eclipse.wst.common.project.facet.core.nature</nature>    
  3.         <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>    
  4.     <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>     
  5. </natures>  

4、项目目录下的.classpath文件,把所有WebRoot字符串改为WebContent,保存。

5、项目目录下的.setting文件夹下的:org.eclipse.wst.common.component文件,把所有WebRoot字符串改为WebContent,保存

6、把目录下WebRoot的文件夹改名为WebContent。

7、在eclipse中Java Resources:src目录的Libraries里添加web服务器需要的包,选择BiuldPath—–>configure Build Path——>当前窗面下选择选择Add Library—–>server Runtime——>选择需要的web服务器

8、在eclipse的项目上点右键,刷新项目。

9、在项目上点右键,进入属性(properties),在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”和”Java”,点击保存即可。


如果项目正常编译没有报错,下次就不用看了。

我遇到这样一个问题,在网上查了半天也没查到什么解决版本,最后自己琢磨了下,


由于MyEclipse里的用到了jstl,导入到Eclipse里也带过来了,怎么把jst.web.jstl和me.spring去掉呢?

1、修改项目.setting文件夹下的org.eclipse.wst.common.project.facet.core.xml文件,把

[java]  view plain  copy
  1. <installed facet="jst.web.jstl" version="1.2.1"/>  
  2. <installed facet="me.spring" version="4.1"/>  
这两行删除。

2、修改.classpath文件,去掉

[java]  view plain  copy
  1. <attribute name="owner.project.facets" value="jst.web.jstl"/>  


PS:

a> 如果不修改第二步,那么你在修改Project facts时,可能会报以下错误:

Failed while changing version of java to 1.8. Project facet jst.web.jstl has not been defined.

b>如果不修改上面的第五部“5、项目目录下的.setting文件夹下的:org.eclipse.wst.common.component文件,把所有WebRoot字符串改为WebContent,保存”,可能会报以下错误:

Eclipse java build path中Web App Libraries无法自动找到WEB-INF的lib目录  




最近在做项目测试,把MyEclipse项目,导入到eclipse里,遇到一些问题,总结如下:

1、进入项目目录,找到.project文件,打开。
增加一个<buildCommand>(如果有的话,就不用添加)

[java]  view plain  copy
  1. <buildCommand>  
  2. <span style="white-space:pre">    </span><name>org.eclipse.wst.validation.validationbuilder</name>  
  3.     <arguments>  
  4.     </arguments>  
  5. </buildCommand>  
2、找到<natures>…</natures>代码段。加入如下标签内容并保存:

[java]  view plain  copy
  1. <natures>  
  2.     <nature>org.eclipse.wst.common.project.facet.core.nature</nature>    
  3.         <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>    
  4.     <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>     
  5. </natures>  

4、项目目录下的.classpath文件,把所有WebRoot字符串改为WebContent,保存。

5、项目目录下的.setting文件夹下的:org.eclipse.wst.common.component文件,把所有WebRoot字符串改为WebContent,保存

6、把目录下WebRoot的文件夹改名为WebContent。

7、在eclipse中Java Resources:src目录的Libraries里添加web服务器需要的包,选择BiuldPath—–>configure Build Path——>当前窗面下选择选择Add Library—–>server Runtime——>选择需要的web服务器

8、在eclipse的项目上点右键,刷新项目。

9、在项目上点右键,进入属性(properties),在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”和”Java”,点击保存即可。


如果项目正常编译没有报错,下次就不用看了。

我遇到这样一个问题,在网上查了半天也没查到什么解决版本,最后自己琢磨了下,


由于MyEclipse里的用到了jstl,导入到Eclipse里也带过来了,怎么把jst.web.jstl和me.spring去掉呢?

1、修改项目.setting文件夹下的org.eclipse.wst.common.project.facet.core.xml文件,把

[java]  view plain  copy
  1. <installed facet="jst.web.jstl" version="1.2.1"/>  
  2. <installed facet="me.spring" version="4.1"/>  
这两行删除。

2、修改.classpath文件,去掉

[java]  view plain  copy
  1. <attribute name="owner.project.facets" value="jst.web.jstl"/>  


PS:

a> 如果不修改第二步,那么你在修改Project facts时,可能会报以下错误:

Failed while changing version of java to 1.8. Project facet jst.web.jstl has not been defined.

b>如果不修改上面的第五部“5、项目目录下的.setting文件夹下的:org.eclipse.wst.common.component文件,把所有WebRoot字符串改为WebContent,保存”,可能会报以下错误:

Eclipse java build path中Web App Libraries无法自动找到WEB-INF的lib目录  




猜你喜欢

转载自blog.csdn.net/qq_36500554/article/details/75764657