Convert Java Project to Web Project in Eclipse

This tutorial shows you how to convert a Java project to Java web application project in Eclipse 4.2, it should work in older version as well.

1. Java Project

A simple Java project.

java project

2. Project Facets

Right click on the project properties. Select “Project Facets“, and click “convert to faceted form…

project facets

Check “Dynamic Web Module” and “Java“, and specify the value.

project facets

By default, Eclipse will generate all “web” related files (like WEB-INF, web.xml) in a “WebContent” folder. If you want change it to another location, Clicks on the “further configuration available…” link.

Modify Faceted Project

3. Web Application Project

Done, the Java project is converted to web application project, see the globe icon on top of the project.

web project
Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • Pingback: see()

  • Pingback: click this()

  • Pingback: alkaline water()

  • Pingback: alkaline water()

  • Pingback: pennsylvania energy choices()

  • Pingback: loan payment plan()

  • Pingback: pay day loans()

  • Pingback: water ionizer()

  • Pingback: payment plan()

  • Pingback: HD Coloring Pages()

  • Pingback: s.c. electricians license()

  • Pingback: house blue()

  • Pingback: this page()

  • Pingback: check my source()

  • Pingback: official source()

  • Pingback: bottled alkaline water()

  • Pingback: pay per day loans plan()

  • Pingback: car parking()

  • Pingback: alkaline water machine()

  • Pingback: laan penge nu uden renter()

  • Pingback: car parking()

  • Pingback: laan penge billigt()

  • Pingback: fue()

  • Pingback: DIRECTV for your company()

  • Pingback: Direct TV vs Dish TV()

  • Pingback: stream movies()

  • Pingback: Blue Coaster33()

  • http://www.bag-variations.com/ mcm phenomenon

    ???

  • Dinesh Kumar

    You are awesome dude :-)

  • http://moldremovaltips.webs.com Desiree

    Amazing! Its genuinely awesome article, I have got much clear idea about from this article.

  • dave h

    This post has helped me many times… thanks for this document… it is a true lifesaver and blessing.

  • Basavaraj

    Thanks.

  • Basavaraj

    Greta!! thanks

  • Shivdhwaj Pandey

    I want to create a simple web project using eclipse helios but cant able to do so in new project there is no option for web projects?

  • https://plus.google.com/117344621220249693166/posts sap

    Hello There. I found your weblog the use of msn. That is a really smartly written article.

    I will be sure to bookmark it and return to
    read more of your helpful info. Thanks for the post.
    I’ll definitely comeback.

  • harsh

    thanks, been a quick help in crucial time !

  • http://gonithethinker.blogspot.com/ Forhad

    I was thinking to do it manually. But this helps me a lot .Simple and basic tool knowledge but effective .

  • mohsin azeem

    any tutorial about pretty faces ? i need that or any good and clear tutorial sites ??

  • fermovalcan

    it’s very helpful today

    it still works ^ ^

  • Paul Furbacher

    Editing the .project file to add natures and builders always had a nasty smell to it. I’d do it, but would hold my nose. What’s the point of an IDE if you have to monkey with files it is supposed to be maintaining.

    At least with Indigo (3.7), I have found it much more convenient (and quicker) to simply open the .settings folder in the Package Explorer, and delete all the files in that folder. If you are nervous about taking such a drastic action, make copies of those files in some other folder before deleting.

    Then open the project’s properties; click on the Project Facets node. All facets will be available for selection. You’ll have to do additional configuration for some facets, but that’s just par for the course.

    One could legitimately criticize this alternative as also having a nasty smell, since I’m monkeying with files which Eclipse should be managing. I wouldn’t disagree. However, for me, it’s a lot less fussy and less error prone than editing natures and builders.

    Of course, the “right” way would be to have the eclipse crew formalize such a conversion in their menus, etc., as they do for converting to Maven or JPA projects, for example.

  • Pingback: Tip: Convert java project to web project in eclipse | Tecnico Programador()

  • http://kawoolutions.com Kawu

    Not sure, but this fix should make this procedure obsolete:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=300182

  • Elridge

    This was very helpful! One thing I had to do to get it to work for me was restart Eclipse after Step 4

  • Engin

    Many thanks to Mkyong !
    It helped me really !

  • cirius

    Thanks a lot for this tip it was very helpful!

  • DALI MOHAMED

    Merci beaucoup pour cet explicatif

  • http://www.berlotto.blog.br Sérgio Berlotto

    Tks for this tip !
    Work fine for me…

  • jakob

    thanks, that helped me out!

    • mkyong

      Good to know it’s worked for you :), actually some guys said this is not working …. but it’s work for you and me at least :)

      • harsh

        Yes it works indeed ! thanks again !

      • http://[email protected] Monty Love

        I tried this in my eclipse 4.2 installation and I don’t see the “Project Facets” item in the
        project properties. What’s up with that?

  • Raja

    Excellent

  • Pingback: How do use Maven to create a Dynamic Web Project in Eclipse? | Maven()