Copy the java code of engine into template.