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

com/Example.java

I am trying to compile using

javac Example.java and it says Example.java is not found.

if I compile using

javac com/Example.java, it works but says it can't find the Treet class. Which I assume is the same problem with it being in the com folder just like the Example file.

Allan Clark
Allan Clark
10,810 Points

What are you using to compile? Workspaces? CMD? What does the file structure of the project look like?

I'm in the workspace compiler. this is my code

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); }

}

I am having the same issue. Another question titled "Workspace not working?" mentioned to restart the browser, however I am still having the issue.

4 Answers

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

In the video lesson the Example class is outside the teemtreehouse folder. Only the Treet file is inside the folder. Example.java needs to be on the same level as the com.

Maybe this is what you made wrong ?

Let us know ....

Yes, I just moved them all around until it worked. Thank you.

I also erased all browser data and history and am still having the issue on Safari

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Maybe

javac Example.java

and then

Example.java

Nope, the error says

javac: file not found: Example.java