Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects Creating the MVP Counting Scrabble Tiles

Hayley Smith
Hayley Smith
4,081 Points

Strange Error on scrabble project

I'm not sure what I've done wrong

com.github.javaparser.ParseException: Encountered "" at line 30, column 4. Was expecting one of: "abstract" ... "boolean" ... "byte" ... "char" ... "class" ... "default" ... "double" ... "enum" ... "final" ... "float" ... "int" ... "interface" ... "long" ... "native" ... "private" ... "protected" ... "public" ... "short" ... "static" ... "strictfp" ... "synchronized" ... "transient" ... "void" ... "volatile" ... ... "{" ... "}" ... ";" ... "@" ... "<" ...

at com.github.javaparser.ASTParser.generateParseException(ASTParser.java:9056)
at com.github.javaparser.ASTParser.jj_consume_token(ASTParser.java:8929)
at com.github.javaparser.ASTParser.ClassOrInterfaceBody(ASTParser.java:857)
at com.github.javaparser.ASTParser.ClassOrInterfaceDeclaration(ASTParser.java:444)
at com.github.javaparser.ASTParser.TypeDeclaration(ASTParser.java:372)
at com.github.javaparser.ASTParser.CompilationUnit(ASTParser.java:185)
at com.github.javaparser.JavaParser.parse(JavaParser.java:111)
at com.github.javaparser.JavaParser.parse(JavaParser.java:133)
at com.teamtreehouse.ast.Inspector.(Inspector.java:41)
at com.teamtreehouse.ast.Inspector.fromSource(Inspector.java:70)
at JavaTester.run(JavaTester.java:68)
at JavaTester.main(JavaTester.java:44)

java.lang.IllegalArgumentException: ParseException: com.github.javaparser.ParseException: Encountered "" at line 30, column 4. Was expecting one of: "abstract" ... "boolean" ... "byte" ... "char" ... "class" ... "default" ... "double" ... "enum" ... "final" ... "float" ... "int" ... "interface" ... "long" ... "native" ... "private" ... "protected" ... "public" ... "short" ... "static" ... "strictfp" ... "synchronized" ... "transient" ... "void" ... "volatile" ... ... "{" ... "}" ... ";" ... "@" ... "<" ...

at com.teamtreehouse.ast.Inspector.fromSource(Inspector.java:73)
at JavaTester.run(JavaTester.java:68)
at JavaTester.main(JavaTester.java:44)

1 Answer

david101
david101
2,088 Points

Can you post your code too as it's hard to figure out without seeing what you are trying to compile and run.

Usually this error does appear if there is a miss match with your open and closing brackets i.e. { } Check that you don't have too many or not enough or that some haven't been closed.