Skip to content

Commit

Permalink
Review and move native-image-configuration-examples to archive/class-…
Browse files Browse the repository at this point in the history
…initialization-examples
  • Loading branch information
olyagpl committed Dec 17, 2024
1 parent 773dab2 commit be37153
Show file tree
Hide file tree
Showing 21 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ In both examples we use the Jackson framework to parse a JSON file to determine

1. Download and install the latest GraalVM JDK using [SDKMAN!](https://sdkman.io/).
```bash
sdk install java 21.0.1-graal
sdk install java 21.0.5-graal
```

2. Download or clone the repository and navigate into the `native-image-configure-examples` directory:
2. Download or clone the repository and navigate into the `class-initialization-examples` directory:
```bash
git clone https://github.com/graalvm/graalvm-demos
```
```bash
cd graalvm-demos/native-image-configure-examples
cd graalvm-demos/archive/class-initialization-examples
```

## Build and Run Examples

1. Change to one of the demo subdirectories, for example, `configure-at-runtime-example`:
```bash
cd graalvm-demos/native-image-configure-examples/configure-at-runtime-example
cd configure-at-runtime-example
```
2. Build the project:
```bash
mvn package
```
3. Once the Maven build succeeds, a native executable called "runtime-example" will be generated in the `configure-at-runtime-example/target/` directory. Run it:
3. Once the Maven build succeeds, a native executable called "runtime-example" will be generated in the _configure-at-runtime-example/target/_ directory. Run it:
```bash
./target/runtime-example
```
Expand All @@ -63,7 +63,4 @@ In both examples we use the Jackson framework to parse a JSON file to determine

Loading application configuration at executable build time can speed up application startup.

### Related Documentation

- [Build-Time Initialization](https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/ClassInitialization/)
- [Initialize Once, Start Fast: Application Initialization at Build Time](http://www.christianwimmer.at/Publications/Wimmer19a/Wimmer19a.pdf)
Learn more about [Class Initialization in Native Image](https://www.graalvm.org/latest/reference-manual/native-image/optimizations-and-performance/ClassInitialization/) at the website, and from the blog post [Understanding Class Initialization in GraalVM Native Image Generation](https://medium.com/graalvm/understanding-class-initialization-in-graalvm-native-image-generation-d765b7e4d6ed).
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
<native.maven.plugin.version>0.10.4</native.maven.plugin.version>
<jackson.version>2.16.0</jackson.version>
</properties>

Expand Down Expand Up @@ -83,9 +83,6 @@
<configuration>
<skip>false</skip>
<imageName>buildtime-example</imageName>
<buildArgs>
--no-fallback
</buildArgs>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
<native.maven.plugin.version>0.10.4</native.maven.plugin.version>
<jackson.version>2.16.0</jackson.version>
</properties>

Expand Down Expand Up @@ -83,9 +83,6 @@
</executions>
<configuration>
<imageName>runtime-example</imageName>
<buildArgs>
--no-fallback
</buildArgs>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit be37153

Please sign in to comment.