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
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.