Move code from java_grinder main function to JavaCompiler.