Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Basics Getting Started with Java Introduction to Your Tools

I do not know were l am getting it wrong on the introduction to java on the workspace

Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:~/workspace$ Is
bash: Is: command not found
treehouse:~/workspace$ java introduction
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Error: Could not find or load main class introduction
treehouse:~/workspace This what l am getting on the work space terminal of which its wrong

After I struggle with the same issue, i found the reason. Do not leave free rows, your code should be written on the 8th row. dont press enter, coz it will leave free space on the 9th row.

3 Answers

Hello Tinashe Sibanda, We're you able to figure out what the problem was? I'm going to guess that you didn't compile the program before running it. Watch the video one more time and notice that Craig writes the program, then compiles it on the command line, then runs the program.

Good luck!

Tony Curington
Tony Curington
867 Points

I keep receiving the same answer. I have re-written the code multiple times and get getting the same error. Error: Could not find or load main class Introductions.java

Tony Curington
Tony Curington
867 Points

Here are the summary of errors. My console does not even compile like Craig's

treehouse:~/workspace$ java Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Error: Could not find or load main class Introductions.java
treehouse:~/workspace$ javac Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:~/workspace$ java Introductions.java

Tony Curington, It looks like you have successfully compiled Introductions.java. You should now see a file called Introductions.class. If so, then you can now run it with the command java Introductions. Notice that it doesn't have the file extension (no .java or .class), just the name of the class.