Cloudfoundry with OpenJDK 11: add JBP_CONFIG_OPEN_JDK_JRE

Posted by Steven

I just upgraded a Java project from Java 8 to OpenJDK 11. The project is running on a Cloudfoundry, using the Java buildpack. After successful deployment with the new Java 11, the application won't start properly and threw the a java.lang.UnsupportedClassVersionError. The solution for this is to add the following variable in Cloudfoundry:

  1. "JBP_CONFIG_OPEN_JDK_JRE" with value "{ jre: { version: 11.+ }}"

This tells the Java buildpack to explicitely use Java 11 instead of the default Java 8. Thanks to my coworker Stefan for pointing this out. :)