Today, we are announcing that you can use GraalVM Enterprise directly in Oracle Cloud Infrastructure (OCI) DevOps build pipelines to build high-performance Java applications, at no additional cost.
GraalVM is a high-performance JDK distribution that accelerates Java workloads. GraalVM Native Image ahead-of-time compilation builds Java applications into native executables that are small, start fast, and use less memory and CPU. At build time, GraalVM Native Image analyzes a Java application and its dependencies to identify just what classes, methods, and fields are necessary and generates optimized machine code for just those elements. Leading Java microservices frameworks such as Spring Boot, Micronaut, Quarkus and Helidon use GraalVM Native Image.
OCI DevOps service provides a continuous integration and deployment (CI/CD) platform for developers to automate the build, test, and deployment of software applications in Oracle Cloud. OCI DevOps build and deployment pipelines reduce change-driven errors and decrease the time customers spend on building and deploying software. The service also includes private Git repositories to store your code and provides connections to external code repositories.
You can install and use GraalVM Enterprise components such as Native Image and Java Development Kit (JDK) by adding a simple YUM package manager command in your build specification file.
Add a command to install one or more required GraalVM Enterprise components. For example, the following command installs Native Image along with JDK and other necessary dependencies.
steps:
- type: Command
name: "Install the latest GraalVM Enterprise 22.x for Java 17 - JDK and Native Image"
command: |
yum -y install graalvm22-ee-17-native-image
Set the JAVA_HOME environment variable.
env:
variables:
"JAVA_HOME" : "/usr/lib64/graalvm/graalvm22-ee-java17"
Set the PATH environment variable.
env:
variables:
# PATH is a reserved variable and cannot be defined as a variable.
# PATH can be changed in a build step and the change is visible in subsequent steps.
steps:
- type: Command
name: "Set the PATH here"
command: |
export PATH=$JAVA_HOME/bin:$PATH
Build a native executable from your Java application.
steps:
- type: Command
name: "Build a native executable with GraalVM Enterprise 22.x for Java 17 - Native Image"
command: |
mvn --no-transfer-progress -Pnative -DskipTests package
Now you can easily build high-performance native Java applications in Oracle Cloud with GraalVM Enterprise and OCI DevOps at no additional cost. For more information, refer to
Documentation: Using GraalVM Enterprise in DevOps Build Pipelines
Sachin Pikle is a Product Strategy Director for GraalVM and Graal Cloud Native in Oracle Labs.