Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Deepak-Sangle/TornadoVM/llms.txt

Use this file to discover all available pages before exploring further.

TornadoVM injects itself deep into the JVM through the JVMCI interface, which means simply opening the project in an IDE and pressing Run will not work out of the box. Every launch configuration must carry the correct module path, a set of --add-exports directives, native library references, and the TornadoVM runtime property bindings. The two officially supported launch strategies — the tornado wrapper script and the java @tornado-argfile argfile approach — both solve this problem, but the argfile approach is the friendlier option for IDE users because the flags live in a plain text file the IDE can reference directly.

Why TornadoVM Needs Special IDE Setup

TornadoVM hooks into the JVM using JVMCI (Java VM Compiler Interface), which requires several non-standard JVM options that ordinary application launchers do not set.

Module System

TornadoVM ships as a set of named Java modules (tornado.runtime, tornado.annotation, tornado.drivers.opencl, etc.) that must be placed on the --module-path at launch time.

Native Libraries

GPU backends rely on native shared libraries (libtornado-opencl.so, libtornado-cuda.so). The JVM must find these via -Djava.library.path.

Graal Exports

The Graal-based JIT compiler used by TornadoVM requires dozens of --add-exports and --add-opens flags to access internal JDK packages.

Runtime Bindings

Several -Dtornado.load.* system properties wire together the runtime, annotation processor, and task-graph engine at startup.

Build Approaches: Tornado Wrapper vs Argfile

Before diving into IDE-specific steps, it is important to understand the two ways to launch a TornadoVM application.
The tornado script is a Python/shell wrapper that constructs the full java command for you, adding every required flag automatically.
# Build the TornadoVM SDK first
make BACKEND=opencl

# Source the environment
source setvars.sh   # Linux/macOS
# setvars.cmd       # Windows

# Run your application
tornado -cp myapp.jar com.example.MyKernel
Pass extra JVM flags with --jvm="...". For example: tornado --jvm="-Xmx8g" -cp myapp.jar com.example.MyKernel
Aspecttornado Wrapperjava @tornado-argfile
Build toolMakeMaven
IDE supportLimitedExcellent
Flags visibilityHidden in wrapperExplicit in argfile
CI/CDTraditional scriptsMaven-native
FlexibilitySimplifiedFull control

IntelliJ IDEA

IntelliJ is the primary recommended IDE for TornadoVM development. The make intellijinit target generates pre-configured run configurations automatically.
1

Install IntelliJ IDEA

Download and install the latest IntelliJ IDEA Community Edition. After installation, increase the maximum heap memory to at least 2 GB via Help → Change Memory Settings (or follow the JetBrains guide).
2

Import and Configure the Project

Open the TornadoVM directory as a Maven project. Then activate the required Maven profiles under View → Tool Windows → Maven:
  • graal-jdk-21
  • opencl-backend
  • cuda-backend (if building CUDA support)
Go to File → Project Structure and verify:
  • Project SDK is set to a valid JDK 21 (OpenJDK 21 or GraalVM JDK 21).
  • Language level is set to 21 for both the project and every module.
3

Build TornadoVM and Generate Run Configs

Before IntelliJ can run anything, TornadoVM must be compiled and the environment sourced. Open a terminal in the project root:
# Build with your desired backend(s)
make BACKEND=opencl          # or: cuda, opencl,cuda, metal

# Load environment variables
source setvars.sh            # Linux/macOS
# setvars.cmd                # Windows

# Generate IntelliJ run configurations into .build/
make intellijinit
IntelliJ will automatically detect the generated configurations from the .build/ directory. You will see TornadoVM-Build and TornadoVM-Tests entries under Run → Edit Configurations → Python.
4

Obtain and Apply the TornadoVM Java Flags

For your own application run configurations, retrieve the full set of flags:
tornado --printJavaFlags
This outputs the complete java invocation. Copy everything from -server to the end. Then in IntelliJ go to Run → Edit Configurations → Application → Add new configuration and paste the flags into the VM Options field.
-server -XX:-UseCompressedOops -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
-XX:-UseCompressedClassPointers --enable-preview
-Djava.library.path=<TORNADOVM_HOME>/bin/sdk/lib
--module-path .:<TORNADOVM_HOME>/bin/sdk/share/java/tornado
-Dtornado.load.api.implementation=uk.ac.manchester.tornado.runtime.tasks.TornadoTaskGraph
...
@<TORNADOVM_HOME>/bin/sdk/etc/exportLists/common-exports
@<TORNADOVM_HOME>/bin/sdk/etc/exportLists/opencl-exports
The flags contain absolute paths. If you move your TornadoVM installation or change backends, re-run tornado --printJavaFlags and update your configurations.
5

Install Required Plugins

Go to Preferences → Plugins → Browse Repositories and install:
  • Eclipse Code Formatter — formats code according to the TornadoVM Eclipse XML style.
  • Save Actions — triggers formatting automatically on save.
  • Python Plugin (optional) — required if you want to run TornadoVM-Build / TornadoVM-Tests configurations.
  • CheckStyle-IDEA (optional) — enforces the TornadoVM code-style rules.
6

Configure the Code Formatter

After installing Eclipse Code Formatter:
  1. Go to File → Settings → Other Settings → Eclipse Code Formatter.
  2. Select Use the Eclipse code formatter.
  3. Load the TornadoVM formatter: ./scripts/templates/eclipse-settings/Tornadovm_eclipse_formatter.xml.
  4. Click Apply.
Then enable Save Actions:
  1. Go to Settings → Other Settings → Save Actions.
  2. Enable Activate save actions on save and Activate save actions in shortcut.
  3. Check Reformat file.
7

Configure CheckStyle (Optional)

  1. Go to File → Settings → Tools → CheckStyle.
  2. Click + to add a new configuration.
  3. Set the description to TornadoVM Checkstyle.
  4. Choose Use a local Checkstyle file and point to tornado-assembly/src/etc/checkstyle.xml.
  5. Click Next → Finish and enable the new configuration.

Eclipse

Eclipse users can configure the TornadoVM code formatter automatically using the provided Python script.
1

Set Up the Formatter

From the project root, run:
python3 scripts/eclipseSetup.py
This script imports scripts/templates/eclipse-settings/Tornadovm_eclipse_formatter.xml into your Eclipse workspace preferences.
2

Configure Run Configuration

Create a new Java Application run configuration and add the TornadoVM flags to the VM Arguments field. Use the same flags produced by tornado --printJavaFlags.

VS Code

VS Code support relies on the Maven for Java extension combined with a manually configured launch.json.
1

Install Extensions

Install the Extension Pack for Java from the VS Code Marketplace, which includes Maven support, debugging, and test runners.
2

Configure launch.json

Add a configuration to .vscode/launch.json that points to the argfile:
{
  "type": "java",
  "request": "launch",
  "name": "TornadoVM Example",
  "mainClass": "uk.ac.manchester.tornado.examples.compute.MatrixMultiplication2D",
  "args": ["512"],
  "vmArgs": "@/path/to/tornadovm/tornado-argfile"
}

IDE Support Comparison

FeatureIntelliJ IDEAEclipseVS Code
Auto-generated run configs✅ via make intellijinit❌ Manual❌ Manual
Code formatter integration✅ Eclipse Code Formatter plugin✅ Native⚠️ Limited
Save-on-format✅ Save Actions plugin✅ Built-in✅ Format on save
Maven profile selection✅ Maven tool window✅ Maven integration✅ Maven extension
Debugger support✅ Full✅ Full✅ Full
CheckStyle integration✅ Plugin✅ Plugin⚠️ Limited
Python script runner✅ Python plugin⚠️ Manual⚠️ Manual
On Windows, always initialize the environment first using bin\windowsMicrosoftStudioTools2022.cmd before running setvars.cmd or any TornadoVM tooling from IntelliJ’s terminal.

Build docs developers (and LLMs) love