Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects Creating the MVP Counting Scrabble Tiles

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,089 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.