Skip to content

Commit

Permalink
[GR-43853] Replace GRAALVM_HOME with JAVA_HOME in docs pages.
Browse files Browse the repository at this point in the history
PullRequest: graal/13683
  • Loading branch information
LesiaChaban committed Feb 6, 2023
2 parents 909560e + cd68dd6 commit 4a70d11
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Further below you will find information on how to add other optionally available
The `java` launcher runs the JVM with the GraalVM default compiler - Graal.
Check the Java version upon the installation:
```shell
$GRAALVM_HOME/bin/java -version
$JAVA_HOME/bin/java -version
```

Take a look at this typical `HelloWorld` class:
Expand Down Expand Up @@ -74,10 +74,10 @@ The JavaScript runtime is optionally available and can be installed with this co
gu install js
```

It installs the `js` launcher in the `$GRAALVM_HOME/bin` directory.
It installs the `js` launcher in the `$JAVA_HOME/bin` directory.
With the JavaScript runtime installed, you can execute plain JavaScript code, both in REPL mode and by executing script files directly:
```shell
$GRAALVM_HOME/bin/js
$JAVA_HOME/bin/js
> 1 + 2
3
```
Expand All @@ -88,21 +88,21 @@ The Node.js support is not installed by default, but can be easily added with th
gu install nodejs
```

Both `node` and `npm` launchers then become available in the `$GRAALVM_HOME/bin` directory.
Both `node` and `npm` launchers then become available in the `$JAVA_HOME/bin` directory.

```shell
$GRAALVM_HOME/bin/node -v
$GRAALVM_HOME/bin/npm show <package name> version
$JAVA_HOME/bin/node -v
$JAVA_HOME/bin/npm show <package name> version
```

More than 100,000 npm packages are regularly tested and are compatible with GraalVM, including modules like express, react, async, request, browserify, grunt, mocha, and underscore.
To install a Node.js module, use the `npm` executable from `$GRAALVM_HOME/bin`, which is installed together with `node`.
To install a Node.js module, use the `npm` executable from `$JAVA_HOME/bin`, which is installed together with `node`.
The `npm` command is equivalent to the default Node.js command and supports all Node.js APIs.

Install the modules `colors`, `ansispan`, and `express` using `npm install`.
After the modules are installed, you can use them from your application.
```shell
$GRAALVM_HOME/bin/npm install colors ansispan express
$JAVA_HOME/bin/npm install colors ansispan express
```

Use the following code snippet and save it as the `app.js` file in the same directory where you installed the Node.js modules:
Expand All @@ -121,7 +121,7 @@ setTimeout(function() { console.log("DONE!"); process.exit(); }, 2000);

Run _app.js_ on GraalVM Enterprise using the `node` command:
```shell
$GRAALVM_HOME/bin/node app.js
$JAVA_HOME/bin/node app.js
```

For more detailed documentation and information on compatibility with Node.js, proceed to [JavaScript and Node.js](../../reference-manual/js/README.md).
Expand All @@ -132,14 +132,14 @@ The GraalVM LLVM runtime can execute C/C++, Rust, and other programming language

The LLVM runtime is optionally available and can be installed with this command:
```shell
$GRAALVM_HOME/bin/gu install llvm
$JAVA_HOME/bin/gu install llvm
```

It installs the GraalVM implementation of `lli` in the `$GRAALVM_HOME/bin` directory.
It installs the GraalVM implementation of `lli` in the `$JAVA_HOME/bin` directory.
Check the version upon the installation:

```shell
$GRAALVM_HOME/bin/lli --version
$JAVA_HOME/bin/lli --version
```

With the LLVM runtime installed, you can execute programs in LLVM bitcode format on GraalVM.
Expand Down Expand Up @@ -181,11 +181,11 @@ gu install python

It installs the `graalpy` launcher. Check the version, and you can already run Python programs:
```shell
$GRAALVM_HOME/bin/graalpy --version
$JAVA_HOME/bin/graalpy --version
```

```shell
$GRAALVM_HOME/bin/graalpy
$JAVA_HOME/bin/graalpy
...
>>> 1 + 2
3
Expand All @@ -204,14 +204,14 @@ gu install ruby

Once it is installed, Ruby launchers like `ruby`, `gem`, `irb`, `rake`, `rdoc`, and `ri` become available to run Ruby programs:
```shell
$GRAALVM_HOME/bin/ruby [options] program.rb
$JAVA_HOME/bin/ruby [options] program.rb
```

GraalVM runtime for Ruby uses the [same options as the standard implementation of Ruby](../../reference-manual/ruby/options.md), with some additions.
For example:
```shell
gem install chunky_png
$GRAALVM_HOME/bin/ruby -r chunky_png -e "puts ChunkyPNG::Color.to_hex(ChunkyPNG::Color('mintcream @ 0.5'))"
$JAVA_HOME/bin/ruby -r chunky_png -e "puts ChunkyPNG::Color.to_hex(ChunkyPNG::Color('mintcream @ 0.5'))"
#f5fffa80
```

Expand All @@ -227,7 +227,7 @@ gu install R

When the language is installed, you can execute R scripts and use the R REPL:
```shell
$GRAALVM_HOME/bin/R
$JAVA_HOME/bin/R
...

> 1 + 1
Expand Down Expand Up @@ -270,7 +270,7 @@ emcc -o floyd.wasm floyd.c

Then you can run the compiled WebAssembly binary on GraalVM as follows:
```shell
$GRAALVM_HOME/bin/wasm --Builtins=wasi_snapshot_preview1 floyd.wasm
$JAVA_HOME/bin/wasm --Builtins=wasi_snapshot_preview1 floyd.wasm
```

More details can be found in the [WebAssembly reference manual](../../reference-manual/wasm/README.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Further below you will find information on how to add other optionally available
The `java` launcher runs the JVM with the GraalVM default compiler - Graal.
Check the Java version upon the installation:
```shell
$GRAALVM_HOME/bin/java -version
$JAVA_HOME/bin/java -version
```

Take a look at this typical `HelloWorld` class:
Expand Down Expand Up @@ -80,10 +80,10 @@ The JavaScript runtime is optionally available and can be installed with this co
gu install js
```

It installs the `js` launcher in the `$GRAALVM_HOME/bin` directory.
It installs the `js` launcher in the `$JAVA_HOME/bin` directory.
With the JavaScript runtime installed, you can execute plain JavaScript code, both in REPL mode and by executing script files directly:
```shell
$GRAALVM_HOME/bin/js
$JAVA_HOME/bin/js
> 1 + 2
3
```
Expand All @@ -94,11 +94,11 @@ The Node.js support is not installed by default, but can be easily added with th
gu install nodejs
```

Both `node` and `npm` launchers then become available in the `$GRAALVM_HOME/bin` directory.
Both `node` and `npm` launchers then become available in the `$JAVA_HOME/bin` directory.

```shell
$GRAALVM_HOME/bin/node -v
$GRAALVM_HOME/bin/npm show <package name> version
$JAVA_HOME/bin/node -v
$JAVA_HOME/bin/npm show <package name> version
```

More than 100,000 npm packages are regularly tested and are compatible with GraalVM Enterprise, including modules like express, react, async, request, browserify, grunt, mocha, and underscore.
Expand All @@ -108,7 +108,7 @@ The `npm` command is equivalent to the default Node.js command and supports all
Install the modules `colors`, `ansispan`, and `express` using `npm install`.
After the modules are installed, you can use them from your application.
```shell
$GRAALVM_HOME/bin/npm install colors ansispan express
$JAVA_HOME/bin/npm install colors ansispan express
```

Use the following code snippet and save it as the `app.js` file in the same directory where you installed the Node.js modules:
Expand Down Expand Up @@ -138,14 +138,14 @@ The GraalVM LLVM runtime can execute C/C++, Rust, and other programming language

The LLVM runtime is optionally available and can be installed with this command:
```shell
$GRAALVM_HOME/bin/gu install llvm
$JAVA_HOME/bin/gu install llvm
```

It installs the GraalVM implementation of `lli` in the `$GRAALVM_HOME/bin` directory.
It installs the GraalVM implementation of `lli` in the `$JAVA_HOME/bin` directory.
Check the version upon the installation:

```shell
$GRAALVM_HOME/bin/lli --version
$JAVA_HOME/bin/lli --version
```

With the LLVM runtime installed, you can execute programs in LLVM bitcode format on GraalVM.
Expand Down Expand Up @@ -187,11 +187,11 @@ gu install python

It installs the `graalpy` launcher. Check the version, and you can already run Python programs:
```shell
$GRAALVM_HOME/bin/graalpy --version
$JAVA_HOME/bin/graalpy --version
```

```shell
$GRAALVM_HOME/bin/graalpy
$JAVA_HOME/bin/graalpy
...
>>> 1 + 2
3
Expand All @@ -210,14 +210,14 @@ gu install ruby

Once it is installed, Ruby launchers like `ruby`, `gem`, `irb`, `rake`, `rdoc`, and `ri` become available to run Ruby programs:
```shell
$GRAALVM_HOME/bin/ruby [options] program.rb
$JAVA_HOME/bin/ruby [options] program.rb
```

GraalVM runtime for Ruby uses the [same options as the standard implementation of Ruby](../../reference-manual/ruby/options.md), with some additions.
For example:
```shell
gem install chunky_png
$GRAALVM_HOME/bin/ruby -r chunky_png -e "puts ChunkyPNG::Color.to_hex(ChunkyPNG::Color('mintcream @ 0.5'))"
$JAVA_HOME/bin/ruby -r chunky_png -e "puts ChunkyPNG::Color.to_hex(ChunkyPNG::Color('mintcream @ 0.5'))"
#f5fffa80
```

Expand All @@ -233,7 +233,7 @@ gu install R

When the language is installed, you can execute R scripts and use the R REPL:
```shell
$GRAALVM_HOME/bin/R
$JAVA_HOME/bin/R
...

> 1 + 1
Expand Down Expand Up @@ -278,7 +278,7 @@ emcc -o floyd.wasm floyd.c

Then you can run the compiled WebAssembly binary on GraalVM as follows:
```shell
$GRAALVM_HOME/bin/wasm --Builtins=wasi_snapshot_preview1 floyd.wasm
$JAVA_HOME/bin/wasm --Builtins=wasi_snapshot_preview1 floyd.wasm
```

More details can be found in the [WebAssembly reference manual](../../reference-manual/wasm/README.md).
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-manual/embedding/embed-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@ native-image --language:python -cp . HelloPolyglot
./hellopolyglot
```

In case an installed GraalVM is available, it is possible to use language homes from the GraalVM home directory. A GraalVM home can be specified at runtime using the option `-Dorg.graalvm.home=$GRAALVM_HOME`, assuming the environment variable `GRAALVM_HOME` is populated with an absolute path to the GraalVM home directory.
In case an installed GraalVM is available, it is possible to use language homes from the GraalVM home directory. A GraalVM home can be specified at runtime using the option `-Dorg.graalvm.home=$JAVA_HOME`, assuming the environment variable `JAVA_HOME` is populated with an absolute path to the GraalVM home directory.
Language homes are automatically discovered in the specified directory. For example:

```shell
./hellopolyglot -Dorg.graalvm.home=$GRAALVM_HOME
./hellopolyglot -Dorg.graalvm.home=$JAVA_HOME
```

> Note: The `-Dorg.graalvm.home` option has precedence over any relative language home paths stored in the image.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-manual/java-on-truffle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Having downloaded the appropriate JAR file in consideration of the operating sys
gu install -L espresso.jar
```

It installs the `jvm` runtime library under the `GRAALVM_HOME/lib/truffle/` location.
It installs the `jvm` runtime library under the `$JAVA_HOME/lib/truffle/` location.

## Run Java on Truffle

Expand Down
2 changes: 1 addition & 1 deletion docs/reference-manual/llvm/Compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for building native projects such as a linker (`ld`), or an archiver (`ar`) for

The LLVM toolchain can be added to GraalVM on demand with the [GraalVM Updater](../graalvm-updater.md) tool:
```shell
$GRAALVM_HOME/bin/gu install llvm-toolchain
$JAVA_HOME/bin/gu install llvm-toolchain
```

The above command will install the LLVM toolchain from the GitHub catalog for GraalVM Community users.
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-manual/llvm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ This allows seamless interoperability with the dynamic languages supported by Gr
Since GraalVM 22.2, the LLVM runtime is packaged in a separate GraalVM component. It can be installed with GraalVM Updater:

```shell
$GRAALVM_HOME/bin/gu install llvm
$JAVA_HOME/bin/gu install llvm
```

This installs GraalVM's implementation of `lli` in the `$GRAALVM_HOME/bin` directory.
This installs GraalVM's implementation of `lli` in the `$JAVA_HOME/bin` directory.
With the LLVM runtime installed, you can execute programs in LLVM bitcode format on GraalVM.

Additionally to installing the LLVM runtime, you can add the LLVM toolchain:
Expand Down
8 changes: 4 additions & 4 deletions docs/reference-manual/native-image/InspectTool.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ redirect_from: /$version/reference-manual/native-image/inspect/
# Native Image Inspection Tool

Native Image Enterprise Edition includes a tool to list the methods included in an executable or shared library created by GraalVM Native Image.
The tool is available as the command `$GRAALVM_HOME/bin/native-image-inspect <path_to_binary>`. It lists methods as a JSON array in the following format:
The tool is available as the command `$JAVA_HOME/bin/native-image-inspect <path_to_binary>`. It lists methods as a JSON array in the following format:

```shell
$GRAALVM_HOME/bin/native-image-inspect helloworld
$JAVA_HOME/bin/native-image-inspect helloworld
{
"methods": [
{
Expand Down Expand Up @@ -52,7 +52,7 @@ The SBOM is also compressed in order to limit the SBOM's impact on the native ex
Even though the tool is not yet supported on Windows, Windows users can still embed the SBOM with this experimental option.
The SBOM is stored in the `gzip` format with the exported `sbom` symbol referencing its start address and the `sbom_length` symbol its size.

After embedding the compressed SBOM into the executable, the tool is able to extract the compressed SBOM using an optional `--sbom` parameter accessible through `$GRAALVM_HOME/bin/native-image-inspect --sbom <path_to_binary>` and outputs the SBOM in the following format:
After embedding the compressed SBOM into the executable, the tool is able to extract the compressed SBOM using an optional `--sbom` parameter accessible through `$JAVA_HOME/bin/native-image-inspect --sbom <path_to_binary>` and outputs the SBOM in the following format:

```json
{
Expand Down Expand Up @@ -91,7 +91,7 @@ The tool can extract the SBOM from both executables and shared libraries.
To scan for any vulnerable libraries, submit the SBOM to a vulnerability scanner.
For example, the popular [Anchore software supply chain management platform](https://anchore.com/) makes the `grype` scanner freely available.
You can check whether the libraries given in your SBOMs have known vulnerabilities documented in Anchore's database.
For this purpose, the output of the tool can be fed directly to the `grype` scanner to check for vulnerable libraries, using the command `$GRAALVM_HOME/bin/native-image-inspect --sbom <path_to_binary> | grype` which produces the following output:
For this purpose, the output of the tool can be fed directly to the `grype` scanner to check for vulnerable libraries, using the command `$JAVA_HOME/bin/native-image-inspect --sbom <path_to_binary> | grype` which produces the following output:
```shell
NAME INSTALLED VULNERABILITY SEVERITY
netty-codec-http2 4.1.76.Final CVE-2022-24823 Medium
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-manual/native-image/JNIInvocationAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The second parameter is a reference to the `jclass` value for the class declarin
The third parameter is a portable (e.g., `long`) identifier of the [Native Image isolatethread](C-API.md).
The rest of the parameters are the actual parameters of the Java `Native.add` method described in the next section. Compile the code with the `--shared` option:
```shell
$GRAALVM/bin/native-image --shared -H:Name=libnativeimpl -cp nativeimpl
$JAVA_HOME/bin/native-image --shared -H:Name=libnativeimpl -cp nativeimpl
```
The `libnativeimpl.so` is generated. We are ready to use it from standard Java code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ The C application takes a string as its argument, passes it to the shared librar
#### Prerequisites
You have set the `GRAALVM_HOME` environment variable to the location of the GraalVM installation.
You have set the `JAVA_HOME` environment variable to the location of the GraalVM installation.
You have have installed LLVM toolchain support to GraalVM, as follows:
```shell
$GRAALVM_HOME/bin/gu install llvm-toolchain
$JAVA_HOME/bin/gu install llvm-toolchain
```

>Note: The llvm-toolchain GraalVM component is not available on Microsoft Windows.
Expand Down Expand Up @@ -115,8 +115,8 @@ $GRAALVM_HOME/bin/gu install llvm-toolchain
2. Compile the Java code and build a native shared library, as follows:

```shell
$GRAALVM_HOME/bin/javac LibEnvMap.java
$GRAALVM_HOME/bin/native-image -H:Name=libenvmap --shared
$JAVA_HOME/bin/javac LibEnvMap.java
$JAVA_HOME/bin/native-image -H:Name=libenvmap --shared
```

It will produce the following artifacts:
Expand Down Expand Up @@ -168,7 +168,7 @@ $GRAALVM_HOME/bin/gu install llvm-toolchain
5. Compile the C application using `clang`.

```shell
$GRAALVM_HOME/languages/llvm/native/bin/clang -I ./ -L ./ -l envmap -Wl,-rpath ./ -o main main.c
$JAVA_HOME/languages/llvm/native/bin/clang -I ./ -L ./ -l envmap -Wl,-rpath ./ -o main main.c
```

6. Run the C application by passing a string as an argument. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This can be useful to identify which objects the Native Image build process allo
For a HelloWorld example, use the option as follows:

```shell
$GRAALVM_HOME/bin/native-image HelloWorld --enable-monitoring=heapdump
$JAVA_HOME/bin/native-image HelloWorld --enable-monitoring=heapdump
./helloworld -XX:+DumpHeapAndExit
Heap dump created at '/path/to/helloworld.hprof'.
```
Expand Down
6 changes: 3 additions & 3 deletions docs/tools/visualvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ VisualVM is shipped as an installable component and can be added to GraalVM usin
gu install visualvm
```

This installs VisualVM in the `$GRAALVM_HOME/bin` directory.
This installs VisualVM in the `$JAVA_HOME/bin` directory.
To start VisualVM, execute `jvisualvm`:

```shell
$GRAALVM_HOME/bin/jvisualvm
$JAVA_HOME/bin/jvisualvm
```
Immediately after startup, the tool shows all locally running Java processes in the Applications area, including the VisualVM process, itself.

Expand Down Expand Up @@ -73,7 +73,7 @@ JFR is a tool for collecting diagnostic and profiling data about a running Java
It is integrated into the Java Virtual Machine (JVM) and causes almost no performance overhead, so it can be used even in heavily loaded production environments.

To install the JFR support, released as a plugin:
1. Run `<GRAALVM_HOME>/bin/jvisualvm` to start VisualVM;
1. Run `$JAVA_HOME/bin/jvisualvm` to start VisualVM;
2. Navigate to Tools > Plugins > Available Plugins to list all available plugins, then install the _VisualVM-JFR_ and
_VisualVM-JFR-Generic_ modules.

Expand Down
2 changes: 1 addition & 1 deletion sulong/docs/contributor/INTEROP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GraalVM LLVM runtime. The [last section](./INTEROP.md#interoperability-and-stati

Detailed reference documentation of Polyglot interop support in the GraalVM LLVM
runtime can be found in [`graalvm/llvm/polyglot.h`](../../projects/com.oracle.truffle.llvm.libraries.graalvm.llvm/include/graalvm/llvm/polyglot.h)
(located in `$GRAALVM_HOME/jre/languages/llvm/include/graalvm/llvm/polyglot.h` in the GraalVM
(located in `$JAVA_HOME/jre/languages/llvm/include/graalvm/llvm/polyglot.h` in the GraalVM
distribution).

To use the functions from `graalvm/llvm/*` headers, binaries have to link against `-lgraalvm-llvm`.
Expand Down
Loading

0 comments on commit 4a70d11

Please sign in to comment.