top of page
Search

Getting Started with TornadoVM 2.0 for Accelerating Java Applications

  • Writer: Thanos Stratikopoulos
    Thanos Stratikopoulos
  • 2 hours ago
  • 2 min read

Starting with TornadoVM 2.0, installing and using TornadoVM is easier than ever. The project now provides prebuilt SDKs for multiple operating systems, architectures, and accelerator backends, and is also available via Maven Central for seamless integration with existing Java codebases.


This guide walks you through:

  • Installing the TornadoVM SDK

  • Verifying your setup

  • Integrating TornadoVM into Java projects using Maven

Prerequisites


Before installing TornadoVM, ensure that your system has the following:

- Java Development Kit (JDK) 21

- JAVA_HOME correctly set to your JDK 21 installation


Downloading and Installing the TornadoVM SDK


TornadoVM SDKs come as ZIP archives tailored for different operating systems, CPU architectures, and accelerator backends. Choose the SDK that matches your setup from the official TornadoVM Releases Page.


Available Backends


  • OpenCL (supports a wide range of GPUs and CPUs)

  • PTX (NVIDIA GPUs)

  • SPIR-V (cross-platform intermediate representation)


Installation Steps by Operating System


Linux (x86_64)

Open a terminal and run:








macOS (Apple Silicon – AArch64)

Open Terminal and execute:








Windows (10+)

Using Command Prompt or PowerShell:

Verifying Your TornadoVM Installation


After installation, verify that TornadoVM is correctly set up by running:


This command lists all available accelerator devices detected by TornadoVM. You should see your GPU or other supported hardware listed.


Check the installed TornadoVM version with:




It should display version 2.1.0 or later.

If these commands work without errors, your TornadoVM installation is ready.


Integrating TornadoVM into Java Projects Using Maven


Since TornadoVM v2.0.0, TornadoVM has been available via Maven Central, which simplifies adding it to your Java projects. To integrate TornadoVM, add the following dependency to your pom.xml:


This setup allows your project to compile and run with TornadoVM support without manual SDK management.


Example: Accelerating a Simple Java Kernel


Here is a basic example class of how to use TornadoVM to accelerate a Java method (vectorAdd):


This example shows how to offload a simple vector addition to the accelerator device detected by TornadoVM.


You can compile and run this class in a new project, as follows:




The output will be something like this:

Coming Soon: SDKMAN! Support

🚀 Stay tuned! TornadoVM SDKs will soon be available via SDKMAN!, enabling one-command installation and seamless version management across platforms.

ree

 
 
bottom of page