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 trialAbhijeet Pednekar
Courses Plus Student 1,566 Pointsgetting an error while loading a file in java repl saying its not a statement
getting an error while loading a file in java repl saying its not a statement
Abhijeet Pednekar
Courses Plus Student 1,566 Pointsload PezDispenser.java
ERROR: ';' expected
load PezDispenser.java;
^
ERROR: not a statement
load PezDispenser.java;
^
Peter Ward
7,912 PointsThe same thing happened to me. Try using the absolute path to the file as this worked for me ie.
:load /home/treehouse/workspace/PezDispenser.java
I obtained the path by running "ls" in the workspace directory to make sure that's where the file was and then "pwd" to get the full path to that directory. Like the following:
treehouse:~/workspace$ ls
Example.class Example.java PezDispenser.class PezDispenser.java
treehouse:~/workspace$ pwd
/home/treehouse/workspace
1 Answer
Bruno Pedroso
2,388 PointsYou are forgetting this statement --> :
The right command is
:load PezDispenser.java
Abhijeet Pednekar
Courses Plus Student 1,566 PointsThanks man
Anjali Paida
533 PointsOooooh yeah..how foolish Iam :P .hmm..but Thank you soo much @Bruno...you saved my time :D
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherCan you copy and paste your command and the response please? We'll get it sorted!