4

Yesterday my application worked fine but when I try to start it today through IntelliJ, I simply get this error:

Connected to the target VM, address: '127.0.0.1:41617', transport: 'socket'
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
    at com.company.app.Application.main(Application.java:18)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more
Disconnected from the target VM, address: '127.0.0.1:41617', transport: 'socket'

Process finished with exit code 1

It's a Spring Boot (1.5.1) app built with Gradle (3.4.1). When I invoke gradle bootRun the app starts without hassle. I already tried re-importing from scratch (deleting the whole directory and git clone it freshly) and deleting the local .gradle directory. In total, two applications are not working anymore but without any code changes since yesterday.

user3105453
  • 1,881
  • 5
  • 32
  • 55

1 Answers1

6

Alright, there seems to be a bug in IntelliJ 2016.3.4 which is not working well together with Gradle 3.4 according to Jetbrain's bug tracker: https://youtrack.jetbrains.com/issue/IDEA-168710

Solution: Either upgrade to IntelliJ 2017 (EAP at time of writing) or downgrade to Gradle 3.3.

Downgrading Gradle is very easy, just type ./gradlew wrapper --gradle-version=3.3 inside your project.

user3105453
  • 1,881
  • 5
  • 32
  • 55