porswengr
porswengr

Reputation: 53

Exception when trying to run/debug spring boot example from intelliJ

Getting a classnotfound exception when trying to run a spring boot example from intelliJ.

I imported one of the 'Getting started guides' from spring.io, specially https://github.com/spring-guides/gs-rest-service.git project into IntelliJ.

I can successfully, build and run the project using ./gradle build and ./gradle bootRun

Now I want to run or debug from IntelliJ,I get following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication

I am trying to run/debug after creating a simple configuration but it throws this exception. How does intelliJ resolve the dependencies. This works from command line when I use gradle bootRun.

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication

Upvotes: 1

Views: 952

Answers (1)

porswengr
porswengr

Reputation: 53

I was able to get past this error by using a new gradle configuration with the 'bootRun' task (in the Run/debug configurations dialog) Initially I had created a spring boot configuration.

Upvotes: 1

Related Questions