You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: native-image/wasm-javac/README.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
1
# Compile `javac` to a Wasm Module
2
2
3
-
In this example, we'll compile the `javac` tool to Wasm modules that can then run on the commandline or the browser.
3
+
This demo illustrates how to use the WebAssembly backend of GraalVM to compile the `javac` tool into a Wasm module that can then run on the command-line or in the browser.
4
4
5
5
## Prerequisites
6
6
7
-
These examples require:
7
+
This demo requires:
8
8
9
-
1. An [Oracle GraalVM Early Access Build](https://github.com/graalvm/oracle-graalvm-ea-builds), version 25.0.0-.ea.15 or later.
9
+
1. An [Early Access Build](https://github.com/graalvm/oracle-graalvm-ea-builds) of Oracle GraalVM for JDK 25 or later.
10
10
For example, using SDKMAN!: `sdk install java 25.ea.15-graal`
11
-
2. The [Binaryen toolchain](https://github.com/WebAssembly/binaryen)on the sytem path, version 119 or later
11
+
2. The [Binaryen toolchain](https://github.com/WebAssembly/binaryen)in version 119 or later and on the system path.
12
12
For example, using Homebrew: `brew install binaryen`
13
13
14
14
15
-
## Run `javac`CLI
15
+
## Run `javac`on Node
16
16
17
-
1. Build the Wasm binary:
17
+
1. Build the Wasm module:
18
18
```bash
19
19
mvn -Pnative package
20
20
```
21
21
Uses the [Native Build Tools](https://graalvm.github.io/native-build-tools/latest/index.html) to run the `native-image` executable from Maven.
22
-
This will generate the Wasm file and its JavaScript wrapperin the `target` directory.
22
+
This command generates a Wasm file and a corresponding JavaScript bindingin the `target` directory.
23
23
24
24
2. Compile a Java file:
25
25
```bash
@@ -28,15 +28,15 @@ These examples require:
28
28
The resulting `HelloWorld.class` file is placed next to `HelloWorld.java`.
29
29
This requires Node.js 22 or later.
30
30
31
-
## Run Web Demo
31
+
## Run `javac` in the browser
32
32
33
-
1. Build the Wasm binary:
33
+
1. Build the Wasm module:
34
34
```bash
35
35
mvn -Pjavacweb package
36
36
```
37
-
This generates the Wasm and JS files into the `web` directory.
37
+
This commandgenerates a Wasm file and a corresponding JavaScript binding in the `web` directory.
0 commit comments