Command of war

broken image

I noticed that in my war I had a folder called META-INF containing a manifest.mf, so I added a line to that declaring my main class as I would to a normal manifest.

broken image

I manually added a manifest to the war and tried again, with the same effect. That failed saying there was no main class defined in the manifest. I presumed the WAR was just like a jar, so java -jar mywar.war params However, I still want to be able to run it from the command line and the code has not changed and is all in there, I just can't figure out how to get it to run. I needed to repackage the code to run under apache and all my code, including the entry point class from the old jar, has ended up in a WAR file for easy deplyment into the web server.

broken image

I have a Java class which has a main and I used to run as a standalone app from the command line e.g.