answered 11/20/2009 How Do You Execute A Java File From The Cmd Of Windows? You must compile the file before executing To compile type: javac filename it will display errors, if any. Then type java filename and your file will be executed