When I cd into $CATALINA_HOME/webapps/myapp/WEB-INF/classes/com/myapp/client issue the following command:
Your class is in the package com.myapp.client. The base of this package ($CATALINA_HOME/webapps/myapps/WEB-INF/classes) should be in your classpath, but it is not. You need to add it and call the class by its fully qualified name (com.myapp.client.ClientApp) so Java knows how to locate it - not with the class-only name (ClientApp) - because that looks like the class should be in the default (unnamed) package.
Same problem with the classpath - the base folder for the package is not in the classpath. But this time you are trying to tell Java that the fully qualified name for the class is "$CATALINA_HOME.webapps.myapp.WEB-INF.classes.com.myapp.ClientApp" (except that the environmental variable $CATALINA_HOME is expanded). You have to add the base folder to your classpath AND give the correct fully qualified name of the class you want to run.
And are you sure this application will run on its own? Apps packed in WARs and run through Tomcat are usually webapps and can't be run from the command line like that.
Joined: Dec 09, 2006
Yes, I was able to get it working by doing this:
Thanks for your great input / feedback!
subject: Help running a standalone Java 6 program which is packaged in a war file and deployed in Tomcat 7