How to invoke remote java program from ssh

How can i invoke java program from MC1, when I connect remotely to execute can I set classpath etc.
____________ <-------------->____________________
|..................|<-------------->|...............................|
|..................|<-------------->|...............................|
|...UNIX (CSH)|<-------------->|...JAVA (JAR) ............|
|..................|<-------------->|...............................|
|...MC 1 .......|<-------------->|...MC 2......................|
|___________|<-------------->|____________________|

Any help is appriciated....

please give me a sample prog..

ssh user@mc2 java -classpath xxx ...

write a wrapper shell script to setup the environment and then execute the script via ssh.