Converting a war file into an executable file

前端 未结 2 1753
旧巷少年郎
旧巷少年郎 2021-01-14 16:58

My company has developed a web application (J2EE environment/Tomcat server) and wants to sell it as a product. Customers can avail this product as basic edition or premium e

2条回答
  •  遥遥无期
    2021-01-14 17:22

    A WAR is a web application archive. It's supposed to be executed on a webserver with a servlet container. An executabele JAR requires a class with a main() method, but a web application normally doesn't have any since that's the responsibility of the servlet container, not the web application. Normally, a WAR is to be distributed as-is, it's the serveradmin's responsibility to deploy it to a servlet container. You can if necessary include some documentation which describes how to do it for various containers.

    If you really intend to sell a web application as a desktop application for some unobvious reason, then your best bet is really to include an embeddable servlet container like Jetty and ship a class with a main() method along it which creates an instance of the embedded servlet container, deploys the WAR file to it and runs the servlet container. This can in turn be wrapped in an executabele JAR.

    Alternatively, you can also host it somewhere on the internet and provide a specific login.

提交回复
热议问题