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

This is a technical issue, CODE CHALLENGE REVIEW is not compiling. Error: Make sure you keep the package statement.....

When trying to CHECK WORK on code challenge I get the following error message:

Make sure you keep the package statement on the first line. There seems to be some problems, use preview to see the compilation errors.

I have recorded it in a 2 minutes video (no audio) for you to look at the exact issue I'm facing. Obviously I have tried this from different browsers by the time I post this.

PLEASE WATCH VIDEO for complete details https://www.screencast.com/t/h3fNx9m0Gfn

com/example/BlogPost.java
package com.example;
import java.util.Date;

public class BlogPost {
    private author;
  private title;
  private body;
  private category;
  Date creationDate;
}

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Ricardo Rodriguez! I agree that the Bummer message is a bit misleading here, but the compiler errors are very real. Java is a "strongly" typed language. This means, that when we declare a variable (even a property in a class), that we must also specify its type. The only place you declared the type of the property was on the Date creationDate. The previous ones are missing their String type. Once you correct this, you will get a new message about naming conventions with member variables.

I highly encourage you to send a message/suggestion to Treehouse Support at help@teamtreehouse.com about possible improvements to this particular Bummer! message. But my guess is that it is hard to tell exactly what's wrong with your code when it cannot compile.

I feel like you can make it past this step with these hints, but let me know if you're still stuck! :sparkles:

You are exactly right!

Thank you so much.