Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-micronaut-webserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Micronaut Web Server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Test Java Code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and run
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-spring-boot-webserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Spring Boot Web Server
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-what-the-dickens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '24'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Test Java Code
Expand Down
8 changes: 4 additions & 4 deletions native-image/containerisation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ In this workshop you will:

Before starting this workshop, you must have installed:

* [GraalVM for JDK 24](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).)
* [GraalVM 25](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).)
```bash
sdk install java 24-graal
sdk install java 25-graal
```
* Container runtime such as [Docker](https://www.docker.com/gettingstarted/), or [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/) installed and running.

Expand Down Expand Up @@ -336,7 +336,7 @@ and the second step copies the native executable into a deployment container.
> The first step in the process builds a Linux-compatible executable and the second step packages that into a container image for deployment.

```dockerfile
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory
WORKDIR /build
Expand Down Expand Up @@ -458,7 +458,7 @@ Again you are going to use a multi-stage build.
Take a look at the contents of the Dockerfile, which has comments to explain each line:

```dockerfile
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory
WORKDIR /build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory to /home/app
WORKDIR /build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory to /home/app
WORKDIR /build
Expand Down
2 changes: 1 addition & 1 deletion native-image/micronaut-webserver/Dockerfile.alpine.static
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a fully static native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a mostly statically linked native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/jdk:24 AS build
FROM container-registry.oracle.com/graalvm/jdk:25 AS build
COPY . /webserver
WORKDIR /webserver
RUN ./mvnw --no-transfer-progress clean package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a dynamically linked native image with default configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a dynamically linked native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a dynamically linked native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM container-registry.oracle.com/graalvm/jdk:24 AS build
FROM container-registry.oracle.com/graalvm/jdk:25 AS build
COPY . /webserver
WORKDIR /webserver
RUN ./mvnw --no-transfer-progress clean package
RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt
RUN CP=$(cat cp.txt) && \
MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 24 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \
MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 25 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \
echo "Modules: $MODULES" && \
jlink \
--module-path "${JAVA_HOME}/jmods" \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/jdk:24 AS build
FROM container-registry.oracle.com/graalvm/jdk:25 AS build
COPY . /webserver
WORKDIR /webserver
RUN ./mvnw --no-transfer-progress clean package
Expand Down
2 changes: 1 addition & 1 deletion native-image/micronaut-webserver/Dockerfile.scratch.static
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a fully static native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild
COPY . /webserver
WORKDIR /webserver

Expand Down
12 changes: 6 additions & 6 deletions native-image/micronaut-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ In this workshop you will:
* x86 Linux
* `musl` toolchain
* Container runtime such as [Docker](https://www.docker.com/gettingstarted/), or [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/) installed and running.
* [GraalVM for JDK 24](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).)
* [GraalVM 25](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).)
```bash
sdk install java 24-graal
sdk install java 25-graal
```

## Setup
Expand Down Expand Up @@ -67,7 +67,7 @@ It requires a container image with a JDK and runtime libraries.

### Explanation

The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:24](https://docs.oracle.com/en/graalvm/jdk/24/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime.
The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:25](https://docs.oracle.com/en/graalvm/jdk/25/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime.
The entrypoint for this image is equivalent to `java -jar`, so only a path to a JAR file is specified in `CMD`.

### Action
Expand Down Expand Up @@ -112,7 +112,7 @@ See how much reduction in size you can gain.
Introduced in Java 11, it provides a way to make applications more space efficient and cloud-friendly.

The script _build-jlink.sh_ that runs `docker build` using the _Dockerfile.distroless-java-base.jlink_.
The Dockerfile contains two stages: first it generates a `jlink` custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:24`); then copies the runtime image folder along with static assets into a distroless Java base image, and sets the entrypoint.
The Dockerfile contains two stages: first it generates a `jlink` custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:25`); then copies the runtime image folder along with static assets into a distroless Java base image, and sets the entrypoint.
Distroless Java base image provides `glibc` and other libraries needed by the JDK, **but not a full-blown JDK**.

The application does not have to be modular, but you need to figure out which modules the application depends on to be able to `jlink` it.
Expand All @@ -123,7 +123,7 @@ RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt
Then, runs `jlink` to create a custom runtime in the specified output directory _jlink-jre_, by using the output of the `jdeps` command to obtain the required modules for this Micronaut application:
```bash
RUN CP=$(cat cp.txt) && \
MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 24 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \
MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 25 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \
echo "Modules: $MODULES" && \
jlink \
--module-path "${JAVA_HOME}/jmods" \
Expand Down Expand Up @@ -238,7 +238,7 @@ In this step, you will build a fully dynamically linked native image **with the

GraalVM Native Image provides the option `-Os` which optimizes the resulting native image for file size.
`-Os` enables `-O2` optimizations except those that can increase code or executable size significantly.
Learn more about different optimization levels in the [Native Image documentation](https://www.graalvm.org/jdk24/reference-manual/native-image/optimizations-and-performance/#optimization-levels).
Learn more about different optimization levels in the [Native Image documentation](https://www.graalvm.org/jdk25/reference-manual/native-image/optimizations-and-performance/#optimization-levels).

To configure the Native Image build and have more manual control over the process, GraalVM provides the [Native Build Tools](https://graalvm.github.io/native-build-tools/latest/index.html): Maven and Gradle plugins for building native images.

Expand Down
2 changes: 1 addition & 1 deletion native-image/native-build-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In workshop lab, you will:

Before starting this workshop, you must have installed:

* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.
* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.

> If you see the laptop icon in the text, this means you need to do something such as enter a command.

Expand Down
16 changes: 8 additions & 8 deletions native-image/native-image-quick-start/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraalVM Native Image Quick Start

This workshop takes you step by step through the process of building a cloud native Java application with [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/).
This workshop takes you step by step through the process of building a cloud native Java application with [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/).
It is aimed at developers with a knowledge of Java.

GraalVM Native Image compiles Java code ahead of time into a self-contained native executable.
Expand Down Expand Up @@ -30,7 +30,7 @@ In this workshop you will perform the following tasks:

Before starting this workshop, you must have installed:

* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.
* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.

> If you see the laptop icon in the text, this means you need to do something such as enter a command.

Expand Down Expand Up @@ -88,7 +88,7 @@ Now that you have a basic understanding of what the application does, build it a

## **STEP 2**: Compile a Java Application into a Native Image

Next, you are going to build a native executable version of the application using [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/).
Next, you are going to build a native executable version of the application using [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/).

#### Action

Expand Down Expand Up @@ -129,7 +129,7 @@ What do the parameters you passed to the `native-image` command in step 1 specif
* `-jar` : Specifies the location of the JAR file containing the Java application. (You can also specify the classpath with `-cp`.)
* `-o`: Specifies the name of the output executable file.

The full list of options can be found [here](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/overview/Options/).
The full list of options can be found [here](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/overview/Options/).

You can also run the `native-image` tool using the [Maven plugin for GraalVM Native Image](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html).
The project `pom.xml` file contains the following snippet that enables the plugin:
Expand Down Expand Up @@ -253,15 +253,15 @@ You need a way to let `native-image` know about any uses of reflection.
Luckily, the `native-image` tool is able to read in the configuration file that specify all classes that are referenced through reflection.

You can write the configuration manually, or, **we recommend using the Tracing agent that comes with GraalVM**.
The [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) collects all instances of reflection, JNI, proxies, and resources access that it can locate while your application is running, and generates the JSON file, _reachability-metadata.json_ in the _resources/META-INF/native-image/_ directory.
The [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) collects all instances of reflection, JNI, proxies, and resources access that it can locate while your application is running, and generates the JSON file, _reachability-metadata.json_ in the _resources/META-INF/native-image/_ directory.

**Note**: It is important to exercise all the code paths in your application when running the agent in order to ensure that all cases of reflection are identified.

The complete documentation for providing configuration can be found [here](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/).
The complete documentation for providing configuration can be found [here](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/).

## **STEP 4**: Use the Tracing Agent
## **STEP 4**: Use the Tracing Agent

Now use the [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) to generate the configuration while you run your application.
Now use the [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) to generate the configuration while you run your application.

1. Run the application with the agent on the JVM:

Expand Down
10 changes: 5 additions & 5 deletions native-image/non-fungible-verses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Create a compute instance
- Image: vanilla Oracle Linux 8

Once the VM is up and running, SSH into it and carry out the following steps:
* Install [Oracle GraalVM for JDK 24](https://docs.oracle.com/en/graalvm/jdk/24/docs/getting-started/oci/compute-instance/).
* Install [Oracle GraalVM 25](https://docs.oracle.com/en/graalvm/jdk/25/docs/getting-started/oci/compute-instance/).
* Stop and disable the firewall of the VM (normally this isn't recommended).
* In the security list for the VCN Subnet of your VM, add an ingress rule for TCP traffic on port 8080.

Expand Down Expand Up @@ -238,13 +238,13 @@ Now move on to running it in a container.

Containerizing a Java application in a container image is straightforward.
You can build a new Docker image based on one that contains a JDK distribution.
For this workshop, you will use a container with the Oracle Linux 8 and the Oracle GraalVM JDK: `container-registry.oracle.com/graalvm/jdk:24`.
For this workshop, you will use a container with the Oracle Linux 8 and the Oracle GraalVM JDK: `container-registry.oracle.com/graalvm/jdk:25`.

The following is a breakdown of the Dockerfile, which describes how to build the Docker image. See the comments to explain the contents.

```dockerfile
# Base Image
FROM container-registry.oracle.com/graalvm/jdk:24
FROM container-registry.oracle.com/graalvm/jdk:25

# Pass in the JAR file as an argument to the image build
ARG JAR_FILE
Expand Down Expand Up @@ -447,7 +447,7 @@ and the second step copies the native executable into a deployment container.
> The first step in the process builds a Linux-compatible executable and the second step packages that into a container image for deployment.

```dockerfile
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory
WORKDIR /build
Expand Down Expand Up @@ -569,7 +569,7 @@ Again you are going to use a multi-stage build.
Take a look at the contents of the Dockerfile, which has comments to explain each line:

```dockerfile
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory
WORKDIR /build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
FROM container-registry.oracle.com/graalvm/native-image:24 AS builder
FROM container-registry.oracle.com/graalvm/native-image:25 AS builder

# Set the working directory to /home/app
WORKDIR /build
Expand Down
2 changes: 1 addition & 1 deletion native-image/reflection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In this workshop you will:

Before starting this workshop, you must have installed:

* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.
* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition.

> If you see the laptop icon in the text, this means you need to do something such as enter a command.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a fully static native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a mostly statically linked native image with optimization for size
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/jdk:24 AS build
FROM container-registry.oracle.com/graalvm/jdk:25 AS build
COPY . /webserver
WORKDIR /webserver
RUN ./mvnw clean package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild
FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild
COPY . /webserver
WORKDIR /webserver
# Build a dynamically linked native image with default configuration
Expand Down
Loading
Loading