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
Scroll to view full table

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_+ }}'
Scroll to view full table

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.

More from Cloud

Modernizing child support enforcement with IBM and AWS

7 min read - With 68% of child support enforcement (CSE) systems aging, most state agencies are currently modernizing them or preparing to modernize. More than 20% of families and children are supported by these systems, and with the current constituents of these systems becoming more consumer technology-centric, the use of antiquated technology systems is archaic and unsustainable. At this point, families expect state agencies to have a modern, efficient child support system. The following are some factors driving these states to pursue modernization:…

7 min read

IBM Cloud Databases for Elasticsearch End of Life and pricing changes

2 min read - As part of our partnership with Elastic, IBM is announcing the release of a new version of IBM Cloud Databases for Elasticsearch. We are excited to bring you an enhanced offering of our enterprise-ready, fully managed Elasticsearch. Our partnership with Elastic means that we will be able to offer more, richer functionality and world-class levels of support. The release of version 7.17 of our managed database service will include support for additional functionality, including things like Role Based Access Control…

2 min read

Connected products at the edge

6 min read - There are many overlapping business usage scenarios involving both the disciplines of the Internet of Things (IoT) and edge computing. But there is one very practical and promising use case that has been commonly deployed without many people thinking about it: connected products. This use case involves devices and equipment embedded with sensors, software and connectivity that exchange data with other products, operators or environments in real-time. In this blog post, we will look at the frequently overlooked phenomenon of…

6 min read

SRG Technology drives global software services with IBM Cloud VPC under the hood

4 min read - Headquartered in Ft. Lauderdale, Florida, SRG Technology LLC. (SRGT) is a software development company supporting the education, healthcare and travel industries. Their team creates data systems that deliver the right data in real time to customers around the globe. Whether those customers are medical offices and hospitals, schools or school districts, government agencies, or individual small businesses, SRGT addresses a wide spectrum of software services and technology needs with round-the-clock innovative thinking and fresh approaches to modern data problems. The…

4 min read