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

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