June 17, 2020 By Kazuki Nobutani 3 min read

IBM Cloud offers several types of services and the IBM Cloud Foundry Platform-as-a-Service (PaaS) offering is one of the most popular and widely used.

The underlying Cloud Foundry (CF) technology allows you to deploy and run your applications without managing servers or clusters, and you can integrate CF with the IBM Cloud Continuous Delivery (CD) service to automate the building and deployment of applications. 

Goal

IBM Cloud Foundry and IBM Cloud Continuous Delivery service are two different technologies, but some users gets confused with the way they work, especially when you specify a Java version to build your applications. In this post, I will explain the differences between the two and how to manage the Java version for your build.

Prerequisites

The Java version depends on the environment

While you can dynamically specify which engine to use for Node.js in package.json, you compile and run your Java application using the Java installed on the machine. Since the space and method that Cloud Foundry and Continuous Delivery service build are different, the installed Java and ways to specify the version to use are different.

How to specify which Java version to use in Cloud Foundry

In order to specify which Java version to use in Cloud Foundry, you need to specify which buildpack to use and set which Java version to use.

First, you need to find out the available buildpacks using the ibmcloud cli:

ibmcloud cf buildpacks

Once you get the filename, research the buildpack on the internet to find out if the desired Java version is included.

Finally, you specify which version of Java to use by following the Configuration and Extension. If you’d like to specify the Open OpenJDK JRE version to run in v7, you need to run the following command:

ibmcloud cf set-env your_app_name JBP_CONFIG_OPEN_JDK_JRE '{jre: { version: 1.7.0_+ }}'

How to specify which Java version to use in Continuous Delivery

On the other hand, if you build with the Continuous Delivery service, you are not going to use buildpacks. Instead, you can use versioned base images to run pipeline jobs to make sure that you are using the specific tools, libraries, and runtimes. Versioned base images help you to make sure that the bits that make up the application and the environment that you deploy the application to are consistent. You can control when the tools, libraries, or runtimes for your application change and update them when it makes sense during the development cycle.

Again, you compile and run your Java application using the Java installed on the machine. So firstly, you need to find out which base image version has the target java version installed. Check the # java-version section in the documentation.

If you need to specify the base image version, open the Delivery Pipeline page and click the three vertical dots to access the list of options:

Then, click Configure Pipeline. In the Image version tab, select the default image version to use for all jobs in your pipeline and click Save:

What’s next?

Every time vulnerabilities are found in Java, a new version gets released with fixes. Sometimes you need time to catch up with the latest version and leave your applications running in previous versions. This technique can help you adapt changes in this rapidly evolving environment. If you have any questions or concerns, please feel free to contact IBM Cloud Support team.

Was this article helpful?
YesNo

More from Cloud

New 4th Gen Intel Xeon profiles and dynamic network bandwidth shake up the IBM Cloud Bare Metal Servers for VPC portfolio

3 min read - We’re pleased to announce that 4th Gen Intel® Xeon® processors on IBM Cloud Bare Metal Servers for VPC are available on IBM Cloud. Our customers can now provision Intel’s newest microarchitecture inside their own virtual private cloud and gain access to a host of performance enhancements, including more core-to-memory ratios (21 new server profiles/) and dynamic network bandwidth exclusive to IBM Cloud VPC. For anyone keeping track, that’s 3x as many provisioning options than our current 2nd Gen Intel Xeon…

IBM and AWS: Driving the next-gen SAP transformation  

5 min read - SAP is the epicenter of business operations for companies around the world. In fact, 77% of the world’s transactional revenue touches an SAP system, and 92% of the Forbes Global 2000 companies use SAP, according to Frost & Sullivan.   Global challenges related to profitability, supply chains and sustainability are creating economic uncertainty for many companies. Modernizing SAP systems and embracing cloud environments like AWS can provide these companies with a real-time view of their business operations, fueling growth and increasing…

Experience unmatched data resilience with IBM Storage Defender and IBM Storage FlashSystem

3 min read - IBM Storage Defender is a purpose-built end-to-end data resilience solution designed to help businesses rapidly restart essential operations in the event of a cyberattack or other unforeseen events. It simplifies and orchestrates business recovery processes by providing a comprehensive view of data resilience and recoverability across primary and  auxiliary storage in a single interface. IBM Storage Defender deploys AI-powered sensors to quickly detect threats and anomalies. Signals from all available sensors are aggregated by IBM Storage Defender, whether they come…

IBM Newsletters

Get our newsletters and topic updates that deliver the latest thought leadership and insights on emerging trends.
Subscribe now More newsletters