Oracle GraalVM on an OCI Compute Instance with Oracle Linux
This guide describes how to install Oracle GraalVM on an Oracle Cloud Infrastructure (OCI) Compute instance with Oracle Linux 7, 8, 9, and 10. For complete beginners, start with this tutorial to create and launch your first Linux instance.
Prerequisites
To replicate the steps in this guide, create a Compute instance and connect to it.
Install Oracle GraalVM
For convenience, the RPM package for Oracle GraalVM 25 is available in the Oracle YUM repository with the package name graalvm-25-native-image.
This distribution includes a JDK and Native Image.
It is self-contained and all the required dependencies will be automatically resolved during the installation.
That means that OCI customers can use Oracle GraalVM in their compute instances, just like any Java Development Kit, by installing it with yum, dnf, or microdnf default package managers, depending on the Oracle Linux version.
Use the following command to connect to the OCI Compute Instance from a Unix-style system:
ssh -i .ssh/id_rsa opc@INSTANCE_PUBLIC_IP
Where .ssh/id_rsa is the full path and name of the file containing your private SSH key; opc is the default name for the Oracle Linux image; and INSTANCE_PUBLIC_IP is the instance IP address provisioned from the console.
For more details, refer to theĀ Connecting to Your Linux Instance Using SSH tutorial.
The installation steps may differ per Oracle Linux version or package manager.
Oracle Linux 10
On Oracle Linux 10 with the yum package manager, run these commands one by one:
sudo yum update -y oraclelinux-release-el10
sudo yum config-manager --set-enabled el10_codeready_builder
sudo yum install graalvm-25-native-image
Confirm that the installed package size is correct by entering yes at the prompt.
On Oracle Linux 10 with dnf or microdnf default package managers, run these commands one by one:
sudo dnf update -y oraclelinux-release-el10
sudo dnf config-manager --set-enabled el10_codeready_builder
sudo dnf install graalvm-25-native-image
Oracle Linux 9
On Oracle Linux 9 with the yum package manager, run these commands one by one:
sudo yum update -y oraclelinux-release-el9
sudo yum config-manager --set-enabled ol9_codeready_builder
sudo yum install graalvm-25-native-image
Confirm that the installed package size is correct by entering yes at the prompt.
On Oracle Linux 9 with dnf or microdnf default package managers, run these commands one by one:
sudo dnf update -y oraclelinux-release-el9
sudo dnf config-manager --set-enabled ol9_codeready_builder
sudo dnf install graalvm-25-native-image
Oracle Linux 8
On Oracle Linux 8 with the yum package manager, run these commands one by one:
sudo yum update -y oraclelinux-release-el8
sudo yum config-manager --set-enabled ol8_codeready_builder
sudo yum install graalvm-25-native-image
Confirm that the installed package size is correct by entering yes at the prompt.
On Oracle Linux 8 with dnf or microdnf default package managers, run these commands one by one:
sudo dnf update -y oraclelinux-release-el8
sudo dnf config-manager --set-enabled ol8_codeready_builder
sudo dnf install graalvm-25-native-image
Oracle Linux 7
- Install a newer devtoolset with GCC version 10 (required by Oracle GraalVM Native Image):
sudo yum -y install oracle-softwarecollection-release-el7sudo yum install devtoolset-10 - Enable the newer devtoolset by default:
echo 'source scl_source enable devtoolset-10' >> ~/.bashrc - Enter a new bash session with the newer devtoolset enabled:
bash - Install the latest Oracle GraalVM:
sudo yum install graalvm-25-native-imageConfirm that the installed package size is correct by entering
yesat the prompt.
Configure Environment Variables
Configure environment variables to point to the Oracle GraalVM installation for this SSH session. After installation, the package files are placed in the /usr/lib64/graalvm directory, and binaries in bin accordingly.
- Set the values of the
PATHandJAVA_HOMEenvironment variables in the bash configuration to point to the location of the Oracle GraalVM installation with the following commands:echo "export JAVA_HOME=/usr/lib64/graalvm/graalvm-java25" >> ~/.bashrcecho 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc - Activate this change:
source ~/.bashrc - Check the values of
PATHandJAVA_HOME, and the Java version to confirm the installation was successful:echo $JAVA_HOMEecho $PATHjava -version
Congratulations! You have installed Oracle GraalVM on the Compute instance with the Oracle Linux image, and can use it as any other Java Development Kit.