Skip to content

Commit feb6dc8

Browse files
patrick96fniephaus
andauthored
fixup! Write README
Co-authored-by: Fabio Niephaus <code@fniephaus.com>
1 parent 3608df7 commit feb6dc8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

native-image/wasm-javac/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# Compile `javac` to a Wasm Module
22

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.
44

55
## Prerequisites
66

7-
These examples require:
7+
This demo requires:
88

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.
1010
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.
1212
For example, using Homebrew: `brew install binaryen`
1313

1414

15-
## Run `javac` CLI
15+
## Run `javac` on Node
1616

17-
1. Build the Wasm binary:
17+
1. Build the Wasm module:
1818
```bash
1919
mvn -Pnative package
2020
```
2121
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 wrapper in the `target` directory.
22+
This command generates a Wasm file and a corresponding JavaScript binding in the `target` directory.
2323

2424
2. Compile a Java file:
2525
```bash
@@ -28,15 +28,15 @@ These examples require:
2828
The resulting `HelloWorld.class` file is placed next to `HelloWorld.java`.
2929
This requires Node.js 22 or later.
3030

31-
## Run Web Demo
31+
## Run `javac` in the browser
3232

33-
1. Build the Wasm binary:
33+
1. Build the Wasm module:
3434
```bash
3535
mvn -Pjavacweb package
3636
```
37-
This generates the Wasm and JS files into the `web` directory.
37+
This command generates a Wasm file and a corresponding JavaScript binding in the `web` directory.
3838

39-
2. Host Web Server:
39+
2. Run a local web server in the `web` directory:
4040
```bash
4141
cd web
4242
jwebserver

0 commit comments

Comments
 (0)