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