Make sure the file SwitchTag.java is in the classpath for thecompilation. If you are compiling from the directory that contains thefile SwitchTag.java, try this:javac -classpath . SwitchTag.java