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

bootrun compilation error

I get the following error when trying to run the AppConfig.java file using bootrun:

`23:21:40: Executing external task 'bootRun'... :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :findMainClass :bootRun FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':bootRun'. No main class specified

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED`

Edit: Added code to give some context:

This is the AppConfig.java file code:

package com.rredondo.gifTeamTreeHouse;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

@EnableAutoConfiguration
class AppConfig
{
public void main(String []args)
{
SpringApplication.run(AppConfig.class, args);
}
}

This is the build.gradle file code:

group 'com.rredondo'
version '1.0-SNAPSHOT' buildscript{
repositories{
mavenCentral()
}
dependencies{
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.6.RELEASE'
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
}

1 Answer

I don't know how much I can help, but try adding your code to your question and maybe that can help us see more of a context of what's happening.