Well you really don't need Tomcat for this. Tomcat is for serving and working with JSP(Java Server Pages). For just compiling your programs like that you only need to use the JDK (Java Development Kit) (Not to be confused with one of our moderators JKD)
To compile this from a command prompt the command would be
you should be in the directory where that file is at. Also you must have your java paths set up correctly. That is needed so that you can use the command javac from any directory that you choose.
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!