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 Objects Meet Objects Creating Classes

';' expected

jshell> javac Example.java
| Error:
| ';' expected
| javac Example.java;

can some one tell what is wrong with this?

1 Answer

Richard Lambert
PLUS
Richard Lambert
Courses Plus Student 7,180 Points

Hello mate,

I don't think you can run the java compiler from within jshell. If you're simply trying to compile your source code, exit out of jshell by typing /exit or CTRL+D and then try running javac Example.java. Typing /help from within jshell will present a list of valid jshell commands, along with an explanation on their use.

Hope this helps

Craig Dennis
Craig Dennis
Treehouse Teacher

Hi chenzhang4 ! Did Richards post help and got you compiling? If so can you please mark his question with Best Answer?

Hope everything is going great now!