If you move a Spring Boot 3 projec to Spring Boot 4, suddenly the h2-console goes missing.
That is because Spring Boot 4 has moved to smaller modules and "com.h2database:h2" does not bundle the console anymore.
Just add the now separate seperate h2-console module to your build.gradle.kts, and all should be well:
dependencies {
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-web")
runtimeOnly("com.h2database:h2")
implementation("org.springframework.boot:spring-boot-h2console")
//...
}