eclipse的工程類型切換

來源:互聯網
上載者:User

onverting a Java project to a Dynamic Web project in Eclipse (基於WTP,通過Project Facets)

What's WTP?
http://www.eclipse.org/projects/project_summary.php?projectid=webtools

引用The Eclipse Web Tools Platform (WTP) project extends the Eclipse platform with tools for developing Web and Java EE applications. It includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing apps.

Converting a Java project to a Dynamic Web project in Eclipse:
http://greatwebguy.com/programming/eclipse/converting-a-java-project-to-a-dynamic-web-project-in-eclipse/

Eclipse – Project Facets:
http://www.beilers.com/2009/05/eclipse-project-facets/

將MyEclipse項目匯入到Eclipse中:
http://todaydiy.blog.163.com/blog/static/104189687201021035312604/

引用1.請首先確保你的eclipse是javaee版本的,或者已經安裝看wtp外掛程式
2.然後修改eclipse工程下的.project檔案: Xml代碼  
  1. <!--在 <natures></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.   
  6. <!--在 <buildSpec></buildSpec>中加入-->  
  7.      <buildCommand>  
  8.         <name>org.eclipse.wst.common.project.facet.core.builder</name>  
  9.         <arguments>  
  10.         </arguments>  
  11.     </buildCommand>  
  12.     <buildCommand>  
  13.         <name>org.eclipse.wst.validation.validationbuilder</name>  
  14.         <arguments>  
  15.         </arguments>  
  16.     </buildCommand>  

3.重新整理項目,項目->右擊->Properties->Project Facets->Modify Project,選擇Java和Dynamic Web Module
          配置Context Root 和Content Directory 以及源碼路徑。

A Error:

引用Java compiler level does not match the version of the installed Java project facet

解決:
http://www.eclipsezone.com/eclipse/forums/t80428.html

引用 A wtp project is composed of multiple units of functionality (known as facets).
Take a look at Project Properties -> Project Facets panel. The java facet version needs to always match the java compiler compliance level.
The best way to change java level is to use the Project Facets properties panel as that will update both places at the same time
Alternatively, when you get the error that you are referring to, there are quick fixes available to resolve it.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.