RFR: 8355798: Implement JEP 514: Ahead-of-Time Command Line Ergonomics [v8]

Ioi Lam iklam at openjdk.org
Wed May 14 06:16:15 UTC 2025


> This is the implementation of the draft [JEP: Ahead-of-time Command Line Ergonomics](https://bugs.openjdk.org/browse/JDK-8350022)
> 
> - Implemented new flag `AOTCacheOutput`, which can be used to create an AOT cache using the "one-command workflow"
> - Added processing of the `JAVA_AOT_OPTIONS` environment variable that can supply extra VM options when creating an AOT cache
> - Added `%p` substitution for `AOTCache`, `AOTCacheOutput`, and `AOTConfiguration` options
> 
> Please see the [JEP](https://bugs.openjdk.org/browse/JDK-8350022) and [CSR](https://bugs.openjdk.org/browse/JDK-8356010) for detailed specification.
> 
> Examples:
> 
> 
> # Create an AOT cache with a single command:
> $ java -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTCacheOutput=foo.aot HelloWorld
> Hello World
> Temporary AOTConfiguration recorded: foo.aot.config
> Launching child process /usr/bin/java to assemble AOT cache foo.aot using configuration foo.aot.config
> Picked up JAVA_TOOL_OPTIONS: -Djava.class.path=HelloWorld.jar -XX:AOTCacheOutput=foo.aot -XX:AOTConfiguration=foo.aot.config -XX:AOTMode=create
> Reading AOTConfiguration foo.aot.config and writing AOTCache foo.aot
> AOTCache creation is complete: foo.aot 10240000 bytes
> 
> # Create logging file for the AOT cache assembly phase
> $ export AOT_TOOL_COMMAND=-Xlog:cds:file=log.txt
> $ java -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTCacheOutput=foo.aot HelloWorld
> 
> 
> Note: the child process is launched with Java API because the HotSpot native APIs are not sufficient (no way to set env vars for child process).

Ioi Lam has updated the pull request incrementally with two additional commits since the last revision:

 - java.md updates from @rose00
 - Resolved differences with CSR JDK-8356010

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24942/files
  - new: https://git.openjdk.org/jdk/pull/24942/files/3cc2cb3a..cd7a5a6b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24942&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24942&range=06-07

  Stats: 748 lines in 9 files changed: 369 ins; 327 del; 52 mod
  Patch: https://git.openjdk.org/jdk/pull/24942.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24942/head:pull/24942

PR: https://git.openjdk.org/jdk/pull/24942


More information about the core-libs-dev mailing list