diff --git a/pom.xml b/pom.xml index a223944..8a4dbf1 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ - 23.1.2 + 24.0.1 @@ -147,6 +147,10 @@ This profile may be removed if no native-image builds are needed. --> native + + ${project.artifactId} + ${project.build.directory}/${image.name} + @@ -164,7 +168,7 @@ - ${project.artifactId} + ${image.name} org.example.embedding.Main --no-fallback @@ -172,6 +176,23 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + default-cli + + exec + + + ${image.path} + + + + + diff --git a/src/main/java/org/example/embedding/Main.java b/src/main/java/org/example/embedding/Main.java index db0534a..b8d91e6 100644 --- a/src/main/java/org/example/embedding/Main.java +++ b/src/main/java/org/example/embedding/Main.java @@ -71,7 +71,7 @@ public static void main(String[] args) throws IOException { break; case "wasm": // with wasm we compute factorial - context.eval(Source.newBuilder("wasm", Main.class.getResource("factorial.wasm")).build()); + context.eval(Source.newBuilder("wasm", Main.class.getResource("factorial.wasm")).name("main").build()); Value factorial = context.getBindings("wasm").getMember("main").getMember("fac"); System.out.println("wasm: factorial(20) = " + factorial.execute(20L)); break;