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

David Axelrod
David Axelrod
36,073 Points

error on running imported file

Yikes!!

not sure where to go from here

Exception in thread "main" java.lang.ClassNotFoundException: com.teamtreehouse.Main
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
Craig Dennis
Craig Dennis
Treehouse Teacher

Which one is this? The TODO one? Did you alter it at all?

David Axelrod
David Axelrod
36,073 Points

its for the treestory2 file. I have all my treehouse projects in a folder off my documents folder and when i ran it the 3 files had little time things on them.

I googled it (it was an insanely vague search haha) and came to the docs and saw it had something to do with configuring content roots?

2 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

TreeStory should be able to just open. File > Open. Try to download it again.

Did you get this working finally?

David Axelrod
David Axelrod
36,073 Points

Everything worked out after I re downloaded it. I worked so hard on that code challenge but it was instantly paid off seeing that little +12 point circle. Great course and i'm looking forward to taking more java courses!

I have the identical error to the line numbers, and I tried redownloading, but it keeps reappearing. A google search told me that the error could be modified by setting a direct path in "Project Structure" to the folder where my classes are, but that solution did not work as well.

I found the fix. Earlier I had just changed the Path under Project Structure > Modules to "Use module compile output path" And I tried taking a look at other files I had and realized that they also had the "Project compiler output" set to the /out folder.

[alt text](C:\Users\Benjamin\Pictures\Screenshots\IntelliJ 1.PNG) [alt text](C:\Users\Benjamin\Pictures\Screenshots\Intellij2.PNG)