How do I run a class in a WAR from the command line?
问题 I have a Java class which has a main and I used to run as a standalone app from the command line e.g. java -jar myjar.jar params 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. 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. Here\'s what I tried.