anchor.diff:  META-INF/native-image/picocli-generated/resource-config.json
   ----
   
  -We are done with our application. Let's make a native image already!
  +We are done with our application. Let's make a native image as the next step!
   
   
   === GraalVM Native Image Toolchain
  
positive.code: .Compiling `CheckSum.java` and creating a `checksum.jar` on Linux. Replace the `:` path separator with `;` for these commands to work on Windows.
  ----
  mkdir classes
  javac -cp .:picocli-4.1.4.jar:picocli-codegen-4.1.4.jar -d classes CheckSum.java
  cd classes && jar -cvef CheckSum ../checksum.jar * && cd ..
  ----
  
  
negative.code: 
  === Creating a Native Image
  
  The `native-image` utility can take a Java application and compile it to a native image that can run as a native executable on the platform that it is compiled on.
  On Linux this can look like this:
  
  .Creating a native image on Linux
  [width=100%]
  ----
  $ /usr/lib/jvm/graalvm/bin/native-image \
      -cp classes:picocli-4.2.0.jar --no-server \
      --static -H:Name=checksum  CheckSum
  ----
  
  The `native-image` utility will take about a minute to complete on my laptop, and produces output like this:
  
  ----
  [checksum:1073]    classlist:   3,124.74 ms,  1.14 GB
  [checksum:1073]        (cap):   2,885.31 ms,  1.14 GB
  [checksum:1073]        setup:   4,767.19 ms,  1.14 GB
  [checksum:1073]   (typeflow):   8,733.59 ms,  1.94 GB
  [checksum:1073]    (objects):   6,073.44 ms,  1.94 GB
  [checksum:1073]   (features):     313.28 ms,  1.94 GB
  [checksum:1073]     analysis:  15,384.41 ms,  1.94 GB
  [checksum:1073]     (clinit):     322.84 ms,  1.94 GB
  [checksum:1073]     universe:     793.02 ms,  1.94 GB
  [checksum:1073]      (parse):   2,191.69 ms,  1.94 GB
  [checksum:1073]     (inline):   2,064.62 ms,  2.13 GB
  [checksum:1073]    (compile):  14,960.43 ms,  2.73 GB
  [checksum:1073]      compile:  20,040.78 ms,  2.73 GB
  [checksum:1073]        image:   1,272.17 ms,  2.73 GB
  [checksum:1073]        write:     722.20 ms,  2.73 GB
  [checksum:1073]      [total]:  46,743.28 ms,  2.73 GB
  ----
  
  At the end, we have a native Linux executable.
  Interestingly, the native binary created with the Java 11 version of GraalVM is a bit bigger than the one created with the Java 8 version of GraalVM:
  
  [source,bash]
  ----
  -rwxrwxrwx 1 remko remko 14744296 Feb 19 09:51 java11-20.0/checksum*
  -rwxrwxrwx 1 remko remko 12393600 Feb 19 09:48 java8-20.0/checksum*
  ----
  
  We can see the binary is 12.4 - 14.7 MB in size.
  We can consider that big or small, depending on what we compare it with.
  For me it is an acceptable size.
  
  Let's run the application to verify that it works.
  While we are at it we may as well compare the startup times of running the application on a normal JIT-based JVM to that of the native image:
  
  ----
  $ time java -cp classes:picocli-4.2.0.jar CheckSum hi.txt
  764efa883dda1e11db47671c4a3bbd9e
  
  real    0m0.415s   ← startup is 415 millis with normal Java
  