Skip to content

Commit

Permalink
Update GraalVM setup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
olyagpl committed Jun 28, 2023
1 parent 7b9332a commit 1d55f0f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 46 deletions.
51 changes: 33 additions & 18 deletions docs/src/docs/asciidoc/graalvm-setup.adoc
Expand Up @@ -2,48 +2,63 @@

image:https://www.graalvm.org/resources/img/logo-colored.svg[GraalVM]

As a prerequisite for building with GraalVM Native Image, a GraalVM JDK is required and the `GRAALVM_HOME` and/or `JAVA_HOME` environment variables need to be set.
A prerequisite for using the Gradle or Maven plugin for GraalVM Native Image is to install GraalVM.
Follow the steps below to setup a GraalVM environment.

Following are the steps needed to obtain and setup a GraalVM environment.
[NOTE]
====
This is just a quick overview, and users can consult the https://www.graalvm.org/docs/getting-started/[GraalVM Getting Started] before proceeding.
====

NOTE: This is just a quick overview, and users can consult the https://www.graalvm.org/docs/getting-started/[GraalVM Getting Started section] before proceeding.
== 1. Download GraalVM

== 1. Obtaining distribution

GraalVM distributions can be obtained from https://www.graalvm.org/downloads/[official website].
Development builds might be available at `releases` section of https://github.com/graalvm/?q=graalvm-ce[official GraalVM Github page projects].
The easiest way to download GraalVM is to use the https://sdkman.io/jdks[SDKMAN!].
To install GraalVM for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graal
sdk install java 17.0.7-graal
```
GraalVM installation includes Native Image.

== 2. Setting up environment variables
== 2. Set up Environment Variables

After obtaining GraalVM distribution environment variable `GRAALVM_HOME` should be set to point to it.
After obtaining a GraalVM distribution, set the `JAVA_HOME` and `PATH` environment variable.

This can be achieved using:
This can be achieved using this command:

.Linux
```bash
export GRAALVM_HOME=/home/${current_user}/path/to/graalvm
export JAVA_HOME=/home/${current_user}/path/to/graalvm
```

.macOS
```bash
export GRAALVM_HOME=/Users/${current_user}/path/to/graalvm/Contents/Home
export JAVA_HOME=/Users/${current_user}/path/to/graalvm/Contents/Home
```

.Windows
```batch
setx /M GRAALVM_HOME "C:\path\to\graalvm"
setx /M JAVA_HOME "C:\path\to\graalvm"
```

NOTE: Preferably user would also set `JAVA_HOME` variable in the same manner (by replacing `GRAALVM_HOME` with `JAVA_HOME` in previous commands).
In the same manner, set up the `PATH` environment variable:

== 3. `native-image` tool installation
.Linux
```bash
export JAVA_HOME=/home/${current_user}/path/to/graalvm/bin:$PATH
```

.Linux / macOS
.macOS
```bash
$GRAALVM_HOME/bin/gu install native-image
export JAVA_HOME=/Users/${current_user}/path/to/graalvm/Contents/Home/bin:$PATH

```

.Windows
```batch
%GRAALVM_HOME%/bin/gu install native-image
setx /M JAVA_HOME "C:\path\to\graalvm\bin;%PATH%"
```

For other installation options, go to the https://www.graalvm.org/downloads/[official website].

Development builds might be available at `releases` section of https://github.com/graalvm/?q=graalvm-ce[official GraalVM Github page projects].
9 changes: 2 additions & 7 deletions docs/src/docs/asciidoc/gradle-plugin-quickstart.adoc
Expand Up @@ -14,17 +14,12 @@ Two ways of building a native executable using the plugin will be demonstrated:
====
The plugin requires that you <<graalvm-setup.adoc#,setup GraalVM>>.
The easiest way to install GraalVM is to use the https://sdkman.io/jdks#grl[SDKMAN!].
To install Oracle GraalVM for JDK 20 or JDK 17, run:
The easiest way to install GraalVM is to use the https://sdkman.io/jdks[SDKMAN!].
To install GraalVM for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graal
sdk install java 17.0.7-graal
```
To install GraalVM Community Edition for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graalce
sdk install java 17.0.7-graalce
```
GraalVM installation includes Native Image.
For other installation options, go to https://www.graalvm.org/downloads/[GraalVM Downloads].
====
Expand Down
9 changes: 2 additions & 7 deletions docs/src/docs/asciidoc/gradle-plugin.adoc
Expand Up @@ -24,17 +24,12 @@ You can find full samples in https://github.com/graalvm/native-build-tools/tree/
====
The plugin requires that you <<graalvm-setup.adoc#,setup GraalVM>>.
The easiest way to install GraalVM is to use the https://sdkman.io/jdks#grl[SDKMAN!].
To install Oracle GraalVM for JDK 20 or JDK 17, run:
The easiest way to install GraalVM is to use the https://sdkman.io/jdks[SDKMAN!].
To install GraalVM for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graal
sdk install java 17.0.7-graal
```
To install GraalVM Community Edition for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graalce
sdk install java 17.0.7-graalce
```
GraalVM installation includes Native Image.
For other installation options, go to https://www.graalvm.org/downloads/[GraalVM Downloads].
====
Expand Down
9 changes: 2 additions & 7 deletions docs/src/docs/asciidoc/maven-plugin-quickstart.adoc
Expand Up @@ -9,17 +9,12 @@ You will create a sample application, enable the plugin, add support for dynamic
====
The plugin requires that you <<graalvm-setup.adoc#,setup GraalVM>>.
The easiest way to install GraalVM is to use the https://sdkman.io/jdks#grl[SDKMAN!].
To install Oracle GraalVM for JDK 20 or JDK 17, run:
The easiest way to install GraalVM is to use the https://sdkman.io/jdks[SDKMAN!].
To install GraalVM for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graal
sdk install java 17.0.7-graal
```
To install GraalVM Community Edition for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graalce
sdk install java 17.0.7-graalce
```
GraalVM installation includes Native Image.
For other installation options, go to https://www.graalvm.org/downloads/[GraalVM Downloads].
====
Expand Down
9 changes: 2 additions & 7 deletions docs/src/docs/asciidoc/maven-plugin.adoc
Expand Up @@ -25,17 +25,12 @@ You can find full samples in https://github.com/graalvm/native-build-tools/tree/
====
The plugin requires that you <<graalvm-setup.adoc#,setup GraalVM>>.
The easiest way to install GraalVM is to use the https://sdkman.io/jdks#grl[SDKMAN!].
To install Oracle GraalVM for JDK 20 or JDK 17, run:
The easiest way to install GraalVM is to use the https://sdkman.io/jdks[SDKMAN!].
To install GraalVM for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graal
sdk install java 17.0.7-graal
```
To install GraalVM Community Edition for JDK 20 or JDK 17, run:
```
sdk install java 20.0.1-graalce
sdk install java 17.0.7-graalce
```
GraalVM installation includes Native Image.
For other installation options, go to https://www.graalvm.org/downloads/[GraalVM Downloads].
====
Expand Down

0 comments on commit 1d55f0f

Please sign in to comment.