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 Local Development Environments Advanced Tooling Teamwork

Ivailo Hristov
Ivailo Hristov
6,297 Points

I can't run Main.java based in treestory project. All three .java's are with list icon with small J on left bottom...

Hello everyone! There are 3 .CLASS files and 3 .java files , nothing compile ...

Exception in thread "main" java.lang.ClassNotFoundException: com.teamtreehouse.Main

Ivailo Hristov
Ivailo Hristov
6,297 Points

After 2 hours of wondering i re-download the file and extract again zip files and then i have no problems :)

2 Answers

Tobias Hallmans
Tobias Hallmans
6,506 Points

Here's what fixed it for me:

Right click "src" -> "Mark Directory as" -> "Sources root"

Grant Murphy
Grant Murphy
10,072 Points

This worked for me.

Nevermind now when I run I get a this: Cannot start compilation: the output path is not specified for module "TreeStory". Specify the output path in the Project Structure dialog.

I have spent nearly 2 hours troubleshooting just trying to get these files to compile.

I was able to figure it out

https://stackoverflow.com/questions/23688702/cannot-start-compilation-the-output-path-is-not-specified-for-module

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,161 Points

Usually when you see this, it means JDK is not defined for project. Or defined improperly.

That is why IDE does not know how to read Java files as classes, and consider them plain Java files.

That is where that small J comes from.

https://www.jetbrains.com/help/idea/2016.3/configuring-global-project-and-module-sdks.html

Restart helps. Sometimes but not everytime.

But sometimes the problem is simply that the structure of the project has changed. Or it is different. So it is better to solve problem by assigning JDK.