1

I already create dynamic web project in eclipse. I can easily make war file of my my dynamic web project. But I want to create ear file from existing project structure. Is it necessary to change my existing project structure before creating ear file? Can anyone help me to give steps for same

1 Answers1

1

File->New Enterprise Application Project

Add existing web project dependecies(you can add multiple web projects).

Then export your Enterprise Application Project as EAR file by right click choose Export option.

jai
  • 98
  • 8
  • Already done this but what is target runtime? What can I choose as target runtime? Also when adding my existing web project into ear how can I check my ear contains source code which I included? What about jars which I copied in lib folder? – Rishi Salunkhe Nov 01 '17 at 05:56
  • You have to choose a target(target runtime) server to deploy your EAR file. It may be apache or JBoss. So first install any server and configure it in your eclipse – jai Nov 01 '17 at 06:00
  • @but it doesnt show anything in target runtime. Also I can not see source code after creating ear file – Rishi Salunkhe Nov 01 '17 at 06:03
  • Window->Show view -> server then create new server. Then it will shown as target runtime – jai Nov 01 '17 at 06:08
  • Choose your Enterprice App. Project -> right click choose Export -> choose Export Source file check box – jai Nov 01 '17 at 06:23
  • In a ear file, there would be only compiled class files. Source won't be included. And for target runtime, you need to install a J2EE server and configured in Eclipse firstly before you can see one. – Alex Nov 01 '17 at 06:27
  • To check ear file contains source code, just change the extension of .ear to .zip, then unzip it, again do the same for war(.war->.zip). Now u can see .class & .java files in package foleder – jai Nov 01 '17 at 06:59