Not able to use Zulu JRE with offline Java Buildpack
search cancel

Not able to use Zulu JRE with offline Java Buildpack

book

Article ID: 297480

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

java-buildpack is able to use Zulu JRE instead of OpenJDK without forking java-buildpack by setting environment variable and restaging:

cf set-env <app_name> JBP_CONFIG_COMPONENTS '{jres: ["JavaBuildpack::Jre::ZuluJRE"]}'
cf restage <app_name>


However, the following error is shown when using Zulu JRE with an offline Java Buildpack:

   Downloaded app package (30.7M)
   -----> Java Buildpack v4.36 (offline) | https://github.com/cloudfoundry/java-buildpack.git#ebf9f057
   [Buildpack]                      ERROR Finalize failed with exception #<RuntimeError: Zulu JRE error: Unable to find cached file for https://cdn.azul.com/zulu/bin/index.yml>
   Zulu JRE error: Unable to find cached file for https://cdn.azul.com/zulu/bin/index.yml
   Failed to compile droplet: Failed to run finalize script: exit status 1
   Exit status 223


Resolution

The Tanzu buildpack is packaged in offline mode. For more information see the script, create-release.sh.

When in offline mode, you only get what is packaged into the bundle. The JBP cannot download anything else. For more information, refer to Offline Package. This is designed for an offline environment with no Internet access.

It packages the latest version of each dependency (as configured in the config/ directory) and disables remote_downloads.


The error occurs because the file doesn't exist in the offline cache and in offline mode, it will only look in the cache.

If you want to use Azul Zulu in an offline buildpack, you need to package the buildpack yourself with Zulu in it.

Otherwise, you need to use an online version of the buildpack. To package the buildpack, follow Building Packages and make sure you adjust the components.yml prior to packaging,  you want this file to indicate Zulu.