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


No 'src' folder in Gradle Project. How to fix this?

From the 'Dependency Management with Gradle' workshop. There's supposed to be a 'src' folder created when you make a Gradle project in Intellij IDEA but the only folders I see are '.gradle', '.idea', and 'gradle'. I have already built the project. Is there any way I can fix this without attempting to create a new project?

Yanuar Prakoso
Yanuar Prakoso
15,196 Points

you can just make it yourself. Just right click on the root directory and choose new>directory the you name it src. The IntelliJ IDEA will recognize it thus when for instance you create main directory inside that newly created src folder IntelliJ will also recognize it as folder where you will put your Java package inside.

1 Answer

After creating a new project, you can create the empty src folder by going to Preferences --> Build, Execution, Deployment category --> Build Tools --> select gradle and you will get the option 'create directories for empty content root automatically'. check it and it's done.