I have a Java Project
, for which I\'m now creating a Web interface, using a Dynamic Web Project
from Eclipse. The Web project consists of a single
Under Eclipse, you can declare Project References for a given project, the web application in your case. To do so, right click on your web application project, then go for Properties > Project References and select the JavaApplication
project. This should allow you to call code from the JavaApplication
project from the WebApplication
without having to build a WAR. This is a solution for development.
For standard deployment (outside the IDE), you should indeed create a standard WAR. To do so, you'll have to package your JavaApplication
as a JAR including the .class
files and the files under /resources
but not the libraries it depends on (JARs under /lib
). These dependencies will actually end up in the WEB-INF/lib
directory of the WAR, beside the JAR of your JavaApplication
. These steps are typically automated with tools like Ant or Maven.