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 Spring Basics Spring Components and Configuring Our App Adding a Spring Configuration File

Rhett Herring
PLUS
Rhett Herring
Courses Plus Student 11,023 Points

Execution failed for task ':findMainClass'.

When using bootrun from Gradle window I get the error "Execution failed for task ':findMainClass'."

When I right click on AppConfig class and choose run... everything works as expected.

How can I set the path for Gradle to run the AppConfig.class as Main...

1 Answer

Rhett Herring
PLUS
Rhett Herring
Courses Plus Student 11,023 Points
used this as my build file:

    plugins {
    id 'java'
    id 'idea'
    id 'eclipse'
    id 'org.springframework.boot' version '2.1.7.RELEASE'
}

group 'com.teamtreehouse'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.springframework.boot:spring-boot-starter-web:2.1.7.RELEASE'
}

Thank you!