// to avoid the compiler complaining with java.util.Date
jClass.removeImport("org.exolab.castor.types.Date");
// add header
JComment comment = new JComment(JComment.HEADER_STYLE);
comment.appendComment(header);
jClass.setHeader(comment);
// print
jClass.print(outputDir, lineSeparator);
}