docs/getting-started/windows.md
GraalVM is available for Windows on the x64 architecture. We recommend installing GraalVM on Windows from an archive.
Navigate to the GraalVM Downloads page{:target="_blank"}. Select the Java version, Windows for the operating system, and download.
Change to the directory where you want to install GraalVM, then move the .zip archive file to it.
Unzip the archive to your file system.
There can be multiple JDKs installed on the machine. The next step is to configure the runtime environment. Setting environment variables via the command line will work the same way for Windows 8, 10, and 11.
JAVA_HOME environment variable to resolve to the GraalVM installation directory, for example:
setx /M JAVA_HOME "C:\Progra~1\Java\<graalvm>"
PATH environment variable to the GraalVM bin directory:
setx /M PATH "C:\Progra~1\Java\<graalvm>\bin;%PATH%"
Note that the /M flag, equivalent to -m, requires elevated user privileges.
echo %PATH%
echo %JAVA_HOME%
Alternatively, you can set up environment variables through a Windows GUI:
JAVA_HOME variable and select it.Repeat the same for the PATH environment variable.
On Windows, Native Image requires Visual Studio and Microsoft Visual C++ (MSVC).
The following minimum versions are required for Native Image compilation:
Note: Earlier versions of Visual Studio may not provide the required compiler features. Use Visual Studio 2022 version 17.13.2 or later for best compatibility.
Download the Visual Studio Build Tools 2022 or later (C development environment) from visualstudio.microsoft.com{:target="_blank"}.
Start the installation by opening the file you downloaded, and then click Continue:
Select the Desktop development with C++ checkbox in the main window. On the right side under Installation Details, make sure that the two requirements, Windows 11 SDK and MSVC (...) C++ x64/x86 build tools, are selected. Continue by clicking Install.
You should now be able to build with GraalVM Native Image.
If Visual Studio is already installed on your system, follow these steps to check that the correct components are installed.
Open the Visual Studio Installer:
Under the Installed tab, click Modify and choose Individual Components:
Then scroll to the bottom and confirm that the Windows 11 SDK and Visual Studio SDK checkboxes are selected. Now you can start using Native Image.
Native Image sets up build environments automatically if it can find an appropriate Visual Studio installation in a known location.
With the GraalVM JDK on your PATH, you can therefore now run the native-image utility in a Command Prompt (cmd) or a PowerShell (pwsh).
To check the native-image version, run:
C:\> native-image.cmd --version
To build a project using the Native Build Tools Maven plugin{:target="_blank"}, run:
mvnw.cmd native:compile
To build a project using the Native Build Tools Gradle plugin{:target="_blank"}, run:
gradlew.bat nativeCompile
This guide was written for Windows 11, but should be valid for Windows 8 and 10.
For other installation options for Windows, visit the GraalVM Downloads page{:target="_blank"}.