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 Build a JavaFX Application Build a Pomodoro App Explore Existing Code

Hey Craig. I've actually tried to run all the projects but I always get a null Exception Error. Why So?

I've tried running all the projects in the zipped folder. I'm always getting a Null pointer on line 15 in main.java

Line 15 is : Font.loadFont(getClass().getResource("/fonts/VarelaRound-Regular.ttf").toExternalForm(), 10);

I've searched a lot for this over the internet. But couldn't find a solution. Please help.

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Thanks Michael,

that worked for me too!

2 Answers

Michael Walker
Michael Walker
45,428 Points

Hello Piyush, I also had the same problem at first. After you import the project, right click on the resources folder in IntelliJ, click on 'Mark Directory As' and then click on Mark as Resources Root as Craig pointed out a couple of videos back. The folder should now be overlapped with a set of a stock of library books (what Craig calls gold coins). After that run Main again and it should work like a charm. :-)

Thank you - that worked for me! :-) +1'd

Bill Wolfe
Bill Wolfe
Courses Plus Student 8,428 Points

Thanks so much, solved about an hour of frustration.

Lingjian Kong
Lingjian Kong
6,330 Points

Thank you Michael? That actually worked for me. Do you know why we should do it?

Awesome man, thanks for that. You literally saved me from quitting! Worked like a charm.