Component Installation

Some languages and functionalities are not part of the GraalVM core distribution and must be downloaded and installed separately. These include:

  • GraalVM Native Image – a technology to compile an application ahead-of-time into a binary that runs natively on the system.
  • Polyglot capabilities – support for Ruby, R and Python.

To assist you with this installation, these features are pre-packaged as Components. The GraalVM installation contains the GraalVM Updater utility, gu, that can be used to manage components. GraalVM Updater also verifies whether the version of the component is appropriate for your GraalVM installation. Component packages are released for each GraalVM release with respective updates. Component packages downloaded for previous release(s) cannot be used with newer ones. Add the GraalVM /bin folder to your PATH environment variable in order to deploy the gu installer tool.

There is a command-line help available. Run gu or gu -h to get command overview. Run gu <command> -h to get help specific for the particular command.

Two modes of component installation are supported:

Manual installation: You download the component package yourself and GraalVM Updater will install it. The following pre-built language packages are at your disposal:

  • native-image.jar
  • python-installable.jar
  • ruby-installable.jar
  • r-installable.jar

Installation from Catalog: There is a list of components maintained by Oracle, from which you can install a component just by name. GraalVM Updater will download the component package for you. This is the default mode of operation.

Installation from Catalog

GraalVM Updater first downloads the list of components, then uses the information in the list to download the actual component package for you and install it. To see which components are available in the catalog, use

gu available

to get a list of available components, their IDs, and descriptive names. Then, the ComponentId (for example ruby) can be used as

gu install ruby

and that is all!

If you want to see more verbose messages during installation, you may use the -v switch to see the download progress bar and verbose messages.

Manual Installation

With the already downloaded component package archive, component.jar, the component can be installed as

gu -L install component.jar

Components List

Installed components can be printed by

gu list

GraalVM Updater can list components in the component catalog (not necessarily installed on your machine):

gu available

Rebuilding Images

GraalVM components used to create guest language implementations may change over time, requiring a Native Image to be rebuilt. Polyglot native image and polyglot native C library may be out of sync, particularly:

  • new languages may not be accessible;
  • removed languages may cause the native binary to fail on missing resources or libraries.

To rebuild and refresh the native binaries, use the following command:

gu rebuild-images [--verbose] polyglot|libpolyglot|js|llvm|python|ruby [custom native-image args]

Uninstallation

Components may be uninstalled from the GraalVM environment when you no longer need them. To uninstall a specific component you need to know its ComponentId, which can be ruby, or r or python. The command to uninstall the component is:

gu remove ruby

If more components end with, for example, ruby, the installer will print an error message that you need to use component’s full names (org.graalvm.ruby). The uninstallation removes the files created during the installation. If a file belongs to multiple components, it will be removed when the last component using it is removed.

Proxies

If GraalVM Updater needs to reach the component catalog, or download a component package, it may need to pass through your HTTP proxy, if your network uses one. On macOS, the proxy settings are automatically obtained from the OS. On Linux, you must ensure that the http_proxy and https_proxy environment variables are set appropriately before you launch gu. Please refer to your distribution and/or desktop environment documentation for the details.

Replacing Components and Files

A component may be only installed once. GraalVM Updater refuses to install a component if a component with the same ID is already installed. But the installed component may be replaced. GraalVM Updater first uninstalls the component and then installs the new package. To replace a component, use the -r option:

gu install -L -r component.jar
gu install -r ruby

The process is the same as if gu remove is run first and gu install next.

GraalVM Updater also refuses to overwrite existing files if the to-be-installed and existing versions differ. There are cases when you may need to refresh file contents, if they were modified or damaged. Use the -o option:

gu install -L -o component.jar
gu install -o ruby

GraalVM Updater will just instruct to replace the contained files of a component. By default, it will not alter anything. You can also use -f (--force) option, which disables most of the checks and allows you to install non-matching versions.