I've created a SpringBoot application and ran into this when trying to launch it:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment
at com.example.DemoApplication.main(DemoApplication.java:10)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.ConfigurableEnvironment
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
I understand it means ConfigurableEnvironment wasn't found in the classpath or the jar containing it not in the classpath. However I doubt this is even the case. I looked up the doc and knew this class is from Spring-core since 3.1, mine in the classpath is 4.3.3, and I double checked like below:
jar tvf spring-core-4.3.3.RELEASE.jar | grep ConfigurableEnvironment
732 Mon Sep 19 14:50:30 EDT 2016 org/springframework/core/env/ConfigurableEnvironment.class
I looked up google and came across this web tool, Spring initilizer and I used it to create the most simple and unpolluted SpringBootApplication, still, it gives me the same error.
I admit I am at my wit end, anyone kindly advice please.