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:
This can also be done via manifest file:
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. :)