No idea why this happens and the errors are sort of sporadic. either it won't start the app or it'll refuse to recompile things. I don't know. In all instances adding public to the class cntainign the main method fixes it. My ask is that either Devtools handles non public main classes or that the generated code on the Spring Initializr not generate classes that are packae private
Comment From: wilkinsona
The problem seems to be specific to Devtools as a package-private main class with a public main method can be launched in an IDE and can also be launched using java -jar.
org.springframework.boot.devtools.restart.MainMethod finds the main method on the package-private class but org.springframework.boot.devtools.restart.RestartLauncher cannot invoke it. For consistency, the method should be made accessible as org.springframework.boot.loader.MainMethodRunner already does.