Community
Participate
Working Groups
An error is returned [Pb(204) Syntax error on token "enum", interface expected] when ASTParser analyzes a simple enum definition package test; public enum Category { } Here is the testcase: ASTParser parser = ASTParser.newParser(AST.JLS3); String source = "package test;\npublic enum Category{}"; parser.setSource(source .toCharArray()); ASTNode root = parser.createAST(null);
You need to set source level to 1.5; using #setCompilerOptions(Map)