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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Christina Vieau](https://secure.gravatar.com/avatar/f15217d37497d38cb8fe585208683e1a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Christina Vieau
679 PointsJShell not finding file, I am in the PezDispenser.java file but the console is giving an error message.
treehouse:~/workspace$ /open PezDispenser.java
bash: /open: No such file or directory
It worked yesterday but had to stop and finish this task today and now it does not find it. Above is the message I am getting. I am in the JavaObjects folder with that particular file open. I did try compiling the file and running it in the console but I received this error message.
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Error: Main method not found in class PezDispenser, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
I believe it is asking me to put my file under the public static void status but I do not want to alter the code since I am trying to copy the class example exactly. I would copy the code I have written but I do not see a copy option in the edit drop down menu of workspace. Any help would be greatly appreciated. Thank you.
2 Answers
![Simon Coates](https://secure.gravatar.com/avatar/6bed20ff9f56a4a1ce9a8d70a9e99565?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Simon Coates
8,223 PointsI'm a little confused. Your initial comment seems to be about using jshell, but you're seemingly running the /open command at a standard terminal prompt. If inside jshell, you'd probably have a prompt that reads "jshell>".
The second part seems to be the console telling you that you don't have a main method. A method with a signature of "public static void main(String[] args)" is necessary for java to run anything. If you could confirm that you have one, have saved and recompiled.
![Christina Vieau](https://secure.gravatar.com/avatar/f15217d37497d38cb8fe585208683e1a?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Christina Vieau
679 PointsHi Simon, You are correct to be confused. After I got my initial error message I tried to compile and run the file in jshell. I did eventually figure that out and once I got back to workspace and compiled and ran the file jshell did not give me an error message. Thank you for your response, you were on point. Christina