See the following tutorial on how to run java applications from the command line:
Getting Started (linux) - Getting Started (windows)