diff --git a/core-java-9/compile-aot.sh b/core-java-9/compile-aot.sh new file mode 100755 index 0000000000..c3a39b0196 --- /dev/null +++ b/core-java-9/compile-aot.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +cd src/main/java +javac com/baeldung/java9/aot/JaotCompilation.java +jaotc --output jaotCompilation.so com/baeldung/java9/aot/JaotCompilation.class + diff --git a/core-java-9/run-aot.sh b/core-java-9/run-aot.sh new file mode 100755 index 0000000000..89fc616469 --- /dev/null +++ b/core-java-9/run-aot.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +cd src/main/java +java -XX:AOTLibrary=./jaotCompilation.so com/baeldung/java9/aot/JaotCompilation \ No newline at end of file diff --git a/core-java-9/src/main/java/com/baeldung/java9/aot/JaotCompilation.java b/core-java-9/src/main/java/com/baeldung/java9/aot/JaotCompilation.java new file mode 100644 index 0000000000..4d8a018d6b --- /dev/null +++ b/core-java-9/src/main/java/com/baeldung/java9/aot/JaotCompilation.java @@ -0,0 +1,12 @@ +package com.baeldung.java9.aot; + +public class JaotCompilation { + + public static void main(String[] argv) { + System.out.println(message()); + } + + public static String message() { + return "The JAOT compiler says 'Hello'"; + } +} \ No newline at end of file