* @throws InvalidSyntaxException if the file has syntax errors.
*/
public static JavaCompilation compile(File file, long version) {
CompilerOptions options = getDefaultCompilerOptions(version);
Parser parser = createCommentRecorderParser(options);
ICompilationUnit cu = createCompilationUnit(FileUtils.getContent(file), file.getName());
CompilationResult compilationResult = createDefaultCompilationResult(cu, options);
return new JavaCompilation(parser.parse(cu, compilationResult), parser.scanner);
}