
Explore GraalVM native image to compile Java applications into fast, platform-specific executables, contrasting static compilation with dynamic JIT, and addressing reflection, JNI, and memory implications.
Learn how to launch Java applications from the terminal, configure PATH and JAVA_HOME, and prepare to compile a Java job application into native executable binaries with the native image compiler.
Understand how the JVM uses the classpath to locate class files, using the -cp option, current and test directories, and the fully qualified names tied to packages.
Define and use the class path environment variable to locate Java classes, distinguishing -cp usage from the class path variable, and explore compiling to a native binary with native image.
Explore how command-line arguments work in native binaries, comparing C++ and Java entry points, argc/argv vs string arrays, and passing system properties in native images.
Explores how Java applications access command line arguments, system properties, and environment variables via the JVM, runtime processes, and native compilation, including jars, manifests, and class paths.
Learn how the macOS default toolchain uses Apple clang to compile native binaries for Java native compilation, install command line tools with Xcode, and verify the toolchain setup.
Discover how to install the Linux default toolchain, GCC, by using apt and build essentials on Ubuntu, verify compilers, and compile a hello world to a native binary.
Set up the Windows default toolchain with MSVC by installing Visual Studio Community, using CL from the command line, and configuring PATH with the vcvars script.
Set up a cross-platform C++ development environment with Eclipse CDT across macOS, Linux, and Windows, and learn to build with make, run from the terminal, and integrate Java Native Interface.
Explore file permissions and attributes for executable binaries in macOS and Linux, using ls and chmod, and build shell scripts to automate Java native image tasks.
Learn to set up GraalVM native image on macOS, install the native image tool, build a native executable from a Java project, and run it with classpath and system properties.
Explore how GraalVM native image compiles a Java application with a main method into a native executable, delivering faster startup and a smaller memory footprint, with Swing and JavaFX limited.
Set up GraalVM native image on Linux Ubuntu. Install OpenJDK 17, configure JAVA_HOME, and install native image with Graal updater, then compile hello world Java program to native executable.
Learn to download, install, and set up GraalVM native image on Windows 10, configure environment variables and paths, and install the required toolchains for native compilation.
Learn to create a hello world Java app and compile it to a native executable using the native image tool, including prerequisites, toolchains, path setup, and classpath options.
Learn how a simple hello world compiles with native image to a native executable, examine the toolchain, class analysis, and image composition including code area, image heap, and reflection considerations.
Explore native image build stages that convert a simple Java hello world into a native executable, detailing initialization, analysis, building universe, parsing, inlining, compiling, and linking.
Explore native image build output options and expert flags, including booleans with plus or minus, to enable code and heap breakdowns, colorful output, and build output prefixes.
Learn how terminal pipelining and redirection enable feeding input to Java programs via standard input, piping outputs, and redirecting results to files, with practical examples of scanners and native image.
Explore using the Eclipse IDE external tool to run native image for Java, leveraging the project classpath and Eclipse's internal environment variables.
Examine Eclipse external tool variables such as Java type name, resource location, and project class path, and learn how runtime substitution and classpath setup enable native image workflows.
Learn to use the Eclipse IDE's external tool with internal variables to tailor commands by project, such as passing the project class path or environment variables as arguments.
Configure Eclipse external tool to build a native image from a Java project, specify the main class, working directory, and class path (including project class path and dependencies), generating executable.
Learn to configure the native image as an external tool in Eclipse for a Maven project, using target/classes, workspace location, and internal variables to build the binary.
Leverage Maven to manage dependencies for native-image compilation in Eclipse, using Maven Central and Guava for gcd, while Eclipse tracks the classpath and builds artifacts independently.
Explore native image classpath options, using -cp or --class-path to include directories or jar files. Learn how java.class.path reveals dependencies and how os path separators affect builds.
Discover how to create executable jar files and compile them to native images by managing classpath, maven dependencies, and ensuring a manifest with the main class.
Examine how the Java reflection API enables dynamic class loading and reflective method invocation, and how native image analyzes static versus runtime reflection for executable generation.
Explore how GraalVM's tracing agent captures dynamic features and reflection to generate native image configuration files, enabling ahead-of-time compilation of Java apps.
Trace dynamic accesses with the native image agent to generate json config files for reflection, JNI, and resources. Use config merge to append runs into meta inf/native image.
Learn how the tracing agent writes configuration periodically during JVM runs, using config write period and initial delay, and how to place files in the meta-inf native image directory.
Learn how to handle text resources when compiling Java to native executables, including bundling text files in jars, classpath access, reading them with Scanner, and encoding considerations.
Learn to load text resources platform-independently with the class loader and getSystemResource, reading them via an input stream into a scanner and embedding them in the native image.
Learn to use the class loader and input streams to load resources from the classpath, embed them into a native image, and build a self-contained, platform-independent Java application.
Learn how the Java native interface (JNI) enables calling C++ from Java, load native libraries at runtime, and embed binaries in a native image, while addressing runtime file path needs.
Extract and embed the JNI dynamic library from the executable, load it via a platform independent resource path using the class loader, and cache the binaries for portability.
Learn how to cache JNI dynamic libraries in the user home directory to enable platform-independent loading of native methods, using class loaders and cached binaries.
Design a command line Java app using the JCommander framework, mapping flags to objects with annotations and a fluent builder. Prepare for native image compilation by configuring reflection and dependencies.
Learn how to use GraalVM native-image tool to compile your Java application to a native executable binary. This allows you to get runtime speeds as fast as C++ applications! This course also teaches you in-depth knowledge of JDK tools and the required knowledge of command-line for running java applications.
- Section 1: Fundamentals of Java Applications
This section teaches you the fundamental concepts such as launching an application in terminal and environment variables such as “PATH” and “CLASSPATH” and how to access them inside a Java application. It also teaches you the meaning of command-line arguments and how to use them in an application.
- Section 2: Default Compiler Tool Chain
This section walks you through the installation process of the default compiler toolchain for each operating system. macOS uses Apple Clang (Xcode), whereas Linux uses the open-source GCC and Windows uses MSVC. You will learn how to ensure the correct installation and configuration of these toolchains.
- Section 3: Introduction to GraalVM Native-Image
This section provides the introduction to GraalVM and native-image. You will learn how to download and install GraalVM and how to run the native-image tool. It walks you through all the steps for writing a simple “HelloWorld” java application and compiling it to a native executable binary.
- Section 4: Compiling Java Applications with Native-Image
This section is the more serious introduction to the native-image tool from GraalVM. You will learn about the outputs that native-image provides while compiling your java application. You will also learn how to provide build configuration by passing various flags to the native-image on the command-line. The important concept of pipelining and redirection of commands on the terminal is also discussed in this section.
- Section 5: Eclipse IDE’s External Tool
This section provides an in-depth introduction to Eclipse’s IDE external tool. It is highly recommended to use Eclipse IDE in conjunction with the native-image tool to seamlessly compile your java applications to the native executable binary. It also shows you how to handle jar dependencies of your java application when using Maven build tool.
- Section 6: Native-Image Options
This section describes the most important flags that you can set when running native-image from the terminal. It also introduces how to handle dynamic features of java such as Reflections, Dynamic class loading, JNI, by invoking the tracing agent that is embedded in the GraalVM’s JVM. Once the configuration files are created, you’ll learn how to pass them to the native-image compiler so that the final executable binary can be run successfully.
- Section 7: Parsing Command-Line Arguments
This interesting section describes the use of a java library called “JCommander” that provides an easy-to-use API for parsing command-line arguments of a java application and creating objects or setting the state of objects. You will learn how to instruct native-image to work with JCommander so that the final executable binary also benefits from easily parsing command-line arguments.
- Section 8: Native-Image Official Documentation
This section provides the link to the online documentation of the native-image tool.
- Section 9: Resources (PowerPoint, source codes, …)
You will find the complete set of PowerPoint slides of the course in this section.