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 Data Structures Getting There Class Review

Albert Tomasura
Albert Tomasura
11,041 Points

Java - Data Structures - Class Review - Code Challenge

Attempting the very first challenge with syntactically and semantically correct code results in "illegal start of expression/not a statement" errors for package, import, and class (basically every line of code at this point).

Also this appears: "Bummer: Make sure you keep the package statement on the first line. There seems to be some problems, use preview to see the compilation errors."

...Even though package is still on line 1. I am fairly confident it is an error within the code challenge itself. It's possible there is some Java code that runs before the user's code challenge attempt that has not been closed properly (missing semicolon, parentheses, etc.).

Albert Tomasura
Albert Tomasura
11,041 Points

I first experienced this problem once packages were being used. Considering that they navigate directories and to do so requires referencing parent folders precisely, it's possible folders were renamed, moved, or deleted.

1 Answer