Export to war not possible in Eclipse

I recently wanted to export a web project into a war file. Everywhere I looked [1] [2] it said: right click on the project then
choose:
Export > War File
or
Export > Web > War File

I did not have those options. The reason was that I had not the correct Eclipse version that supports Dynamic Web Projects. You need the Eclipse IDE for Java EE Developers that you can download from download.eclipse.org.

If you, like me, have a running Eclipse version with tons of other plugins and just want to export the war file adding the necessary plugin is the more convenient way. Following the Eclipse Wiki [3]:

Go to Help > Install new Software

Install New Software

Choose All Available Sites

All Available Sites

Open the Web, XML, Java EE and OSGi Enterprise Development section

Web, XML, Java EE ...

Choose these three:

  • Eclipse Java EE Developer Tools
  • JST Server Adapters Extensions
  • Eclipse Java Web Developer Tools

Choose Plugins

Press next and then accept any license agreements.

Review items to install

Then Finish all plugins will be installed.

 

 

[1] http://stackoverflow.com/questions/4032421/how-to-create-an-war-file-in-eclipse-without-ant-or-maven
[2] http://stackoverflow.com/questions/5108019/how-to-make-war-file-in-eclipse
[3] https://wiki.eclipse.org/WTP_FAQ#How_do_I_install_WTP.3F

4 People think it's helpful 😀

4 Comments Export to war not possible in Eclipse

  1. David

    Awesome, thanks! I am curious, how did you know which to download? Did you do some kind of inspection? Just how did you know these are the ones that are needed?

    Reply
    1. Lars Händler

      A bit try’n’error combined with the knowledge that the Java EE version was needed. I also used a few searches on stackoverflow – that always brings me on the right track.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *