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
This demo illustrates how to use GraalVM Web Image to compile a Spring Shell application into a Wasm module that can then run on the command-line or in the browser. [Check out the live demo here](https://graalvm.github.io/graalvm-demos/native-image/wasm-spring-shell/).
4
+
5
+
## Prerequisites
6
+
7
+
This demo requires:
8
+
9
+
1. This [Early Access Build](https://github.com/graalvm/oracle-graalvm-ea-builds/releases/tag/jdk-25e1-25.0.0-ea.01) of Oracle GraalVM 25.1 or later.
10
+
2. The [Binaryen toolchain](https://github.com/WebAssembly/binaryen) in version 119 or later and on the system path.
11
+
For example, using Homebrew: `brew install binaryen`
12
+
13
+
## Run Spring Shell on Node
14
+
15
+
1. Build the Wasm module with the `native` profile:
16
+
```bash
17
+
$ ./mvnw -Pnative package
18
+
```
19
+
The demo uses the [Native Build Tools](https://graalvm.github.io/native-build-tools/latest/index.html) for building native images with GraalVM and Maven.
20
+
This command generates a Wasm file and a corresponding JavaScript binding in the `target` directory.
Copy file name to clipboardExpand all lines: native-image/wasm-spring-shell/src/main/java/com/example/wasm_spring_shell/WasmSpringShellApplication.java
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,14 @@
1
+
/*
2
+
* Copyright (c) 2025, Oracle and/or its affiliates.
3
+
*
4
+
* Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.org/license/UPL.
Copy file name to clipboardExpand all lines: native-image/wasm-spring-shell/src/test/java/com/example/wasm_spring_shell/WasmSpringShellApplicationTests.java
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
/*
2
+
* Copyright (c) 2025, Oracle and/or its affiliates.
3
+
*
4
+
* Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.org/license/UPL.
0 commit comments