Java Native Compiler in depth

th_vIZeyP4GcuOAuvXh3qzvHVg2WCkRZ46u

了解如何使用 GraalVM 原生映像工具将您的 Java 应用程序编译为原生可执行二进制文件。这使您能够获得与 C++ 应用程序一样快的运行速度!本课程还教您深入了解 JDK 工具以及运行 Java 应用程序所需的命令行知识。

– 第 1 部分:Java 应用程序的基础知识

本节向您介绍基本概念,例如在终端中启动应用程序和环境变量(例如“PATH”和“CLASSPATH”)以及如何在 Java 应用程序中访问它们。它还教您命令行参数的含义以及如何在应用程序中使用它们。

– 第 2 节:默认编译器工具链

本节将引导您完成每个操作系统的默认编译器工具链的安装过程。macOS 使用 Apple Clang (Xcode),而 Linux 使用开源 GCC,Windows 使用 MSVC。您将学习如何确保正确安装和配置这些工具链。

– 第 3 节:GraalVM Native-Image 简介

本节介绍 GraalVM 和 native-image。您将学习如何下载和安装 GraalVM 以及如何运行本机映像工具。它会引导您完成编写简单的“HelloWorld”java 应用程序并将其编译为本机可执行二进制文件的所有步骤。

– 第 4 节:使用 Native-Image 编译 Java 应用程序

本节是对 GraalVM 的 native-image 工具的更严肃的介绍。您将了解在编译 java 应用程序时 native-image 提供的输出。您还将学习如何通过在命令行上将各种标志传递给 native-image 来提供构建配置。本节还讨论了终端上命令的流水线和重定向的重要概念。

– 第 5 部分:Eclipse IDE 的外部工具

本节深入介绍了 Eclipse 的 IDE 外部工具。强烈建议将 Eclipse IDE 与 native-image 工具结合使用,以将您的 java 应用程序无缝编译为本机可执行二进制文件。它还向您展示了在使用 Maven 构建工具时如何处理 Java 应用程序的 jar 依赖项。

– 第 6 节:本机图像选项

本节介绍从终端运行 native-image 时可以设置的最重要的标志。它还介绍了如何通过调用嵌入在 GraalVM 的 JVM 中的跟踪代理来处理 Java 的动态特性,例如反射、动态类加载、JNI。创建配置文件后,您将学习如何将它们传递给本机映像编译器,以便最终的可执行二进制文件可以成功运行。

– 第 7 节:解析命令行参数

这个有趣的部分描述了一个名为“JCommander”的 java 库的使用,它提供了一个易于使用的 API,用于解析 java 应用程序的命令行参数并创建对象或设置对象的状态。您将学习如何指示 native-image 与 JCommander 一起工作,以便最终的可执行二进制文件也可以从轻松解析命令行参数中受益。

– 第 8 节:Native-Image 官方文档

本部分提供了指向本机映像工具的在线文档的链接。

– 第 9 部分:资源(PowerPoint、源代码……)

您将在本节中找到课程的完整 PowerPoint 幻灯片。

Published 08/2022
MP4 | Video: h264, 1280×720 | Audio: AAC, 44.1 KHz, 2 Ch
Genre: eLearning | Language: English + srt | Duration: 43 lectures (16h 11m) | Size: 7.94 GB

Compile Your Java Application to Native Executable Binary

What you’ll learn
Compile Java Application into Native Executable Binary
How Java Virtual Machine Executes an Application
How to Develop a Command-Line Application
Details of JVM Internals such as ClassPath

Requirements
Basic understanding of Java
Basic understanding of terminal and command-line
Basic understanding of C++

Description
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.

Who this course is for
Java Developers
Java Enthusiasts

资源下载此资源仅限VIP下载,请先
本站资源仅限VIP会员下载点击购买VIP会员

原创文章,作者:steven,如若转载,请注明出处:https://rr3d.cn/35977.html

赞 (0)
steven的头像steven
上一篇 2022年8月1日
下一篇 2022年8月1日

相关推荐

发表回复

登录后才能评论
分享本页
返回顶部