Wednesday, June 22, 2011

Eclipse: How to convert a Java Project into a Web Project

Eclipse Version: Helios Service Release 1

Java projects do not have the Export->WAR File option. To get this option you must convert your Java project into a web project.

Step 1: Create a new Dynamic Web Project
Step 2: Open the Dynamic Web Projects .project file and copy the following lines of XML to your Java projects .project file.


[2011-06-15 14:01:36 - ddms]null

<buildspec>
...
<buildcommand>   <name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
...
</buildSpec>

<natures>
...
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
...
</natures>


Step 3: Within the Java projects Project Facets enable the Dynamic Web Module and Java.

No comments:

Post a Comment