How to Docker with Spring Boot

Matt Raible

I tried Java 15 with Gradle and the same error happens. To help diagnose your issue, I created a new project with Maven.


curl https://start.spring.io/starter.tgz -d dependencies=web,okta <br> -d bootVersion=2.4.1 <br> -d groupId=com.okta <br> -d artifactId=demospringboot <br> -d language=kotlin <br> -d baseDir=docker-maven-demo | tar -xzvf -

Then, I tried building it with the command below:


./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=springbootdemo -Dspring-boot.build-image.builder=heroku/spring-boot-buildpacks

I see the same error:


[INFO] [creator] [Installing Java]
[INFO] [creator] /cnb/buildpacks/heroku_jvm/0.1/lib/jvm.sh: line 93: jdkUrl: unbound variable
[INFO] [creator] ERROR: failed to build: exit status 1

If I change the Java version to 11 in pom.xml (or build.gradle.kts), it works.