Using Java 8 with Bluemix (on Liberty Runtime & DevOps Service)

About this document

Here's how to change the Java version of Bluemix from 7 to 8. There are two settings, the Runtime that runs the app and the DevOps Service, which is a CI tool. I don't think this article will be valid for a long time, as the default will be Java 8 in the meantime, but I'm a little troubled with using it, so I'll share it.

Java version of Bluemix

As of January 2017, the default Java version seems to be 7.

However, Liberty Buildpack Updates: Java 8, Java EE 7 updates, and more! --Bluemix Blog As you can see in -java-ee-7-updates /), Java 8 can be used from May 2015, isn't it?

Change Runtime version from 7 to 8

In the above link, the method to set using the cf command was posted. Specifically, it is a method like cf set-env myApp JBP_CONFIG_IBMJDK" version: 1.8. + ".

Of course, the above method is fine, but I don't usually use cf, so I will use the method of setting from the GUI.

Select Runtime from the application dashboard and select the ʻEnvironment variables` tab.

 2017-01-18 at 18.26.40.png

After that, in NAME of ʻUser defined, in JBP_CONFIG_IBMJDK, VALUE Specifyversion: 1.8. +`.

 2017-01-18 at 18.26.58.png

If you save after specifying, the reflection is completed. Please note that the application will be restarted as soon as this SAVE is executed.

Change DevOps Service version from 7 to 8

I remember it used to be called Delivery Pipeline. In short, it's a CI tool. The value specified as the environment variable of the above application is not shared by the CI tool, so it must be specified separately here as well.

Select Configure Stage for Build State.

 2017-01-18 at 18.31.52.png

Then put ʻexport JAVA_HOME = ~ / java8;inBuild Shell Command. In the case of my example, when using the build tool Gradle, extra description is added, but basically, what was originally written (the part that does not start with #, starts with #" Is a comment), just add ʻexport JAVA_HOME = ~ / java8;.

In this environment (shell), ; is a delimiter, so don't forget to add it.

 2017-01-18 at 18.32.55.png

This will also be reflected if you save it.

That's all for the settings. There is nothing to know, but it's surprisingly troublesome to find out. I hope the default version goes up soon.

Thank you until the end.

Recommended Posts

Using Java 8 with Bluemix (on Liberty Runtime & DevOps Service)
Using proxy service with Java crawling
Using JupyterLab + Java with WSL on Windows 10
Using Mapper with Java (Spring)
Using multiple versions of Java with Brew on Mac + jEnv
Using Java on OSX 10.15 (Catalina) β
Install Java with zip on Windows
Try using Redis with Java (jar)
Using Java with AWS Lambda-Eclipse Preparation
Html5 development with Java using TeaVM
Using Java with AWS Lambda-Implementation-Check CloudWatch Arguments
Try using the service on Android Oreo
Using Java with AWS Lambda-Implementation-Stop / Launch EC2
One-JAR Java EE application with WebSphere Liberty
Notes on operators using Java ~ String type ~
Sobel filter using OpenCV on Android (Java)
Java version control with jenv on OSX
Notes on using FCM with Ruby on Rails
Install Java8 with Yum on Amazon Linux
Game development with two people using java 2
I tried using OpenCV with Java + Tomcat
Game development with two people using java 1
Build OpenCV with Java Wrapper on Ubuntu 18.04
Game development with two people using java 3
Try using the Wii remote with Java
[Android] [Java] Download images on GCS (Google Cloud Storage) with Stream using Glide
Try using Firebase Cloud Functions on Android (Java)
Using templates on the classpath with Apache Velocity
Interact with LINE Message API using Lambda (Java)
Install java and android-sdk on Mac using homebrew
Easily switch Java versions with alias on macOS
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Try Azure Service Fabric (Java) on Mac-Local Environment
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Specify ClassPath when using jupyter + Java with WSL
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Using Gradle with VS Code, build Java → run
Try communication using gRPC on Android + Java server
Build a Java runtime environment on Sakura VPS