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 - Retired Getting There Packages

peterbristow
peterbristow
10,403 Points

[Java] The declared package "com.teamtreehouse" does not match the expected package ""

Hi Peeps

I am using a Text editor (VSCode) to follow along with the course.

After saving Treet.java I get the following error for the package declaration line in the Treet.java file:

[Java] The declared package "com.teamtreehouse" does not match the expected package ""

After I compile and run the code, it still works as expected but I don't understand why I am getting this linter error. Can anyone help me sort this out please?

My folder/file structure is: com/ teamtreehouse/ Treet.class Treet.java Example.class Example.java

-- Treet.java file -- package com.teamtreehouse;

public class Treet { } -- End of file --

-- Example.java file -- import com.teamtreehouse.Treet;

public class Example { public static void main(String[] args) { Treet treet = new Treet(); System.out.printf("This is a new Treet: %s %n", treet); } } -- End of file --