Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

java_buildpack configuration for JRE version ignored #42

@gmuth

Description

@gmuth

local.yml:

applications:
  - name: myjavaapp
    buildpacks:
      - java_buildpack
    env:
      JBP_CONFIG_OPEN_JDK_JRE: "{ jre: { version: 11.+ }}"

stage java 11 application:

cf local stage myjavaapp -p target/myjavaapp.jar

Buildpack: will detect                                                         
-----> Java Buildpack v4.27 | https://github.com/cloudfoundry/java-buildpack.git#e06e00b
-----> Downloading Jvmkill Agent 1.16.0_RELEASE from https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/jvmkill-1.16.0-RELEASE.so (found in cache)
-----> Downloading Open Jdk JRE 1.8.0_265 from https://java-buildpack.cloudfoundry.org/openjdk/bionic/x86_64/bellsoft-jre8u265%2B1-linux-amd64.tar.gz (found in cache)
       Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.0s)

The default JRE 1.8.x is used, not JRE 11.+ as requested. Consequently starting fails:

Running myjavaapp on port 55683...                                                  
JVM Memory Configuration: -Xmx424887K -Xss1M -XX:ReservedCodeCacheSize=240M -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=111688K
Exception in thread "main" java.lang.UnsupportedClassVersionError: mypackage/MyJavaApplication has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions