Are you trying to run a jar? If so you need to use the -jar option.

Are you trying to run a class file? If so you need to drop the .java part of the filename.