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


Samir Doshi
Samir Doshi
868 Points

You all are awesome! I tried to run the app and it came up with a gradle error - couldn't find the java file correctly?

The error looked like this: (in a dialogue pop up box after I tried to run the fun facts app in the emulator)

Failed to complete gradle execution.

Cause: Supplied JavaHome is not a valid folder.

What should I do!

1 Answer

Hi Samir,

Well seems like your path to JDK is not set properly.

In Android Studio, right click on the project name on the top (in the project structure on the left), then select Open Module Settings . In the window that appears check if the path to JDK is correct like here


In Windows the link is usually ProgramFiles/Java/jdk_version/

Although, if you haven't yet downloaded the JDK prior to working with Android Studio then download here Oracle JDK Download Link. Download for your respective OS

Hope this helps