Skip to content

Commit ba16cee

Browse files
Maiklinspivovarit
authored andcommitted
BAEL-2572 Ahead of Time Compilation (AoT) (eugenp#6275)
1 parent e6f9af4 commit ba16cee

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

core-java-9/compile-aot.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
cd src/main/java
3+
javac com/baeldung/java9/aot/JaotCompilation.java
4+
jaotc --output jaotCompilation.so com/baeldung/java9/aot/JaotCompilation.class
5+

core-java-9/run-aot.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
cd src/main/java
3+
java -XX:AOTLibrary=./jaotCompilation.so com/baeldung/java9/aot/JaotCompilation
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung.java9.aot;
2+
3+
public class JaotCompilation {
4+
5+
public static void main(String[] argv) {
6+
System.out.println(message());
7+
}
8+
9+
public static String message() {
10+
return "The JAOT compiler says 'Hello'";
11+
}
12+
}

0 commit comments

Comments
 (0)