I think this should work, but ``` Exception in th...
# announcements
x
I think this should work, but
Copy code
Exception in thread "main" java.lang.NoSuchMethodException: com.potrero.Application.main([Ljava.lang.String;)
	at java.base/java.lang.Class.getDeclaredMethod(Class.java:2476)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Copy code
package com.potrero

import org.apache.logging.log4j.LogManager
import org.springframework.beans.factory.getBeanProvider
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.info.BuildProperties
import org.springframework.boot.runApplication

@SpringBootApplication
open class Application

fun main(args: Array<String>) {
    val ctx = runApplication<Application>(*args)
    ctx.getBeanProvider<BuildProperties>().ifAvailable {
        LogManager.getLogger(Application::class.java).info("Starting {}", it.artifact)
    }
}
shouldn’t this kotlin class work to start spring boot?
s
#C0B8ZTWE4