# Java Hello World, LLVM Edition

DevFeed: [Java Hello World, LLVM Edition](<https://devfeed.tech/articles/java-hello-world-llvm-edition-23022.md>)

Original publisher: [Read original article](<https://www.javaadvent.com/2025/12/java-hello-world-llvm-edition.html>)

Author: James Hamilton

Published: 2025-12-07T02:02:37Z

Content type: tutorial

Language: en

Sources: [Java Advent Calendar](<https://devfeed.tech/sources/java-advent-calendar.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [api](<https://devfeed.tech/tags/api.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [clang](<https://devfeed.tech/tags/clang.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compile](<https://devfeed.tech/tags/compile.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [core-libraries](<https://devfeed.tech/tags/core-libraries.md>), [debian](<https://devfeed.tech/tags/debian.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [ir](<https://devfeed.tech/tags/ir.md>), [java](<https://devfeed.tech/tags/java.md>), [java-advent](<https://devfeed.tech/tags/java-advent.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [jit](<https://devfeed.tech/tags/jit.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [libc](<https://devfeed.tech/tags/libc.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [llvm-ir](<https://devfeed.tech/tags/llvm-ir.md>), [machine](<https://devfeed.tech/tags/machine.md>), [memory](<https://devfeed.tech/tags/memory.md>)

## AI overview

The article shows how to generate and run LLVM IR from Java instead of generating Java bytecode. Using Java's Foreign Function & Memory (FFM) API, it calls the LLVM C API to build a "Hello, World!" program and JIT-compile it to native code. The excerpt explains that LLVM IR is a strongly typed, SSA-based intermediate language with in-memory, bitcode, and readable assembly forms. It describes installing LLVM's shared libraries and headers locally, then introduces a textual IR example that can be run with `lli`; the example uses a global string, declares libc's `puts`, defines `main`, and calls `puts`. The excerpt ends as it begins introducing the FFM API, so implementation details beyond this setup are not available.

## Source excerpt

After exploring Java bytecode in previous years (2022, 2023, 2024), this year we'll take an unexpected detour for a Java advent: instead of generating Java bytecode, we'll use Java to build and execute LLVM IR, the intermediate language behind compilers like clang. Using Java's Foreign Function & Memory (FFM) API, we'll call the LLVM C [...] The post Java Hello World, LLVM Edition appeared first on JVM Advent.