How to import Java EE classes to Eclipse? [duplicate]

让人想犯罪 __ 提交于 2019-12-22 03:41:07

问题


I already have installed Java SDK following which, I later also Downloaded Java EE which was not automatically Installed in Eclipse. How do I import the Java EE libraries in Eclipse?


回答1:


Download and install/unpack your favorite Java EE container (for web applications use Tomcat)

Download and start the Java EE edition of Eclipse

In the Server panel create a new local server corresponding to the above Java EE container.

Create a new "Web -> Dynamic Web Project" using the server defined above. Set the "Servlet API level" to 2.4 or 2.5 depending on your needs.

The new project will have access to the appropriate Java EE libraries.




回答2:


Another solution would be to use the p2 mechanism (to rpovisioning system to update eclipse, if you are using eclipse3.5 Galileo) to get WTP (Web Tool Platform) SDK.

The SDK comes with JST (j2ee Standard Tools Project), extend eclipse platform with support for building multi-tier J2EE applications.


Another (extreme) solution would be to get the J2EE edition of eclipse which includes all you need (you can then refer to your previous workspace -- through an eclipse.ini -- in order to retrieve exactly your projects you were working one)




回答3:


I'd suggest using Maven along with the m2eclipse plugin. This will import all of the packages you need for you.



来源:https://stackoverflow.com/questions/1448167/how-to-import-java-ee-classes-to-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!