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

Getting Execution failed for task ':bootRun'

The stack trace keeps pointing to the SpringApplication.run(AppConfig.class, args); line in AppConfig.java. I have no idea how to fix this, my code looks identical to the video, its just running with modern updates.

1 Answer

It seems as though the port 8080 is already being used.

Try adding a new file to src/main/resources called application.properties with the following code:

server.port = 1234

Set 1234 to the desired port number, or set to 0 for a random port number.