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 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.