I have a Spring+Hibernate application, which I compile to *.war file and deploy it to Tomcat. This works for me as developer, but:
Is there a way to run that application in some user’s computer, that has Java installed, but not tomcat installed?
I would even accept the solution, which uses somekinda package that actually runs the servlet container and deploys the application to user’s computer, but I don’t want that user must install container and configure it etc etc.
Any suggestions?
EDIT:
Basically I want user to run my web application from an executable, without having to install tomcat or other tools.
You have a few options:
if you are distributing the source code to the user, and they have maven installed, you can just run
mvn jetty:runormvn tomcat:runto build the application locally and run it within a servlet container started by the Maven plugin.You can embed Tomcat or embed Jetty in your application, so that running a
main()method in your app launches a servlet container listening on a certain port and runs your application. This makes it possible to package your entire application as a single.jarfile and have it be run withjava -jar your.jar.