BAEL-2572 Ahead of Time Compilation (AoT) (#6275)

This commit is contained in:
Maiklins 2019-02-08 16:22:10 +01:00 committed by Grzegorz Piwowarek
parent e6f9af4c3f
commit ba16cee334
3 changed files with 20 additions and 0 deletions

5
core-java-9/compile-aot.sh Executable file
View File

@ -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

3
core-java-9/run-aot.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
cd src/main/java
java -XX:AOTLibrary=./jaotCompilation.so com/baeldung/java9/aot/JaotCompilation

View File

@ -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'";
}
}