Skip to content

Instantly share code, notes, and snippets.

@lilac
Last active October 8, 2023 02:53
Show Gist options
  • Save lilac/8dd6fee280002954de43f14a567bc8e7 to your computer and use it in GitHub Desktop.
Save lilac/8dd6fee280002954de43f14a567bc8e7 to your computer and use it in GitHub Desktop.
Native Image of Java Hello World

Steps to try native-image

  • Follow the official guide to generate the image.
    • On my macbook, the generated file is about 13MB.
  • Try to inspect the image size via a dump. The dump can be generated with a special flag.
    native-image HelloWorld -H:+DashboardAll
    
  • Go to this web page to view the result of this dump.

References

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment