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 trialAbby Holzinger
1,293 Pointscom/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.
Abby Holzinger
1,293 PointsI'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); }
}
Govinda Tamburino
4,569 PointsI 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
10,365 PointsIn 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 ....
Abby Holzinger
1,293 PointsYes, I just moved them all around until it worked. Thank you.
Govinda Tamburino
4,569 PointsI also erased all browser data and history and am still having the issue on Safari
Grigorij Schleifer
10,365 PointsMaybe
javac Example.java
and then
Example.java
Abby Holzinger
1,293 PointsNope, the error says
javac: file not found: Example.java
Grigorij Schleifer
10,365 PointsGreat !!!!!
:)
Allan Clark
10,810 PointsAllan Clark
10,810 PointsWhat are you using to compile? Workspaces? CMD? What does the file structure of the project look like?