[code-reflection] RFR: New example suite for code reflection [v2]
Juan Fumero
duke at openjdk.org
Mon Aug 11 09:04:47 UTC 2025
> New example suite for code reflection. It includes two programs that illustrate different functionality of the code reflection API.
>
> ### How to build?
>
> This module is built using the code-reflection fork of OpenJDK. Then, update the `JAVA_HOME` to point to the code-reflection port, and compile with maven. In detail:
>
> #### 1. Build Babylon JDK
>
> We need to use the JDK build that enables the code reflection API (Babylon).
>
>
> git clone https://github.com/openjdk/babylon
> cd babylon
> bash configure --with-boot-jdk=${JAVA_HOME}
>
>
> Then, we use the built JDK as `JAVA_HOME`
>
>
> export JAVA_HOME=/$HOME/repos/babylon/build/macosx-aarch64-server-release/jdk/
> export PATH=$JAVA_HOME/bin:$PATH
>
>
> #### 2. Build the example suite
>
>
> mvn clean package
>
>
> #### 3. Run the examples
>
> ##### Run HelloCodeReflection
>
>
> java --enable-preview -cp target/crsamples-1.0-SNAPSHOT.jar oracle.code.samples.HelloCodeReflection
>
>
> ##### Run MathOptimizer
>
>
> java --enable-preview -cp target/crsamples-1.0-SNAPSHOT.jar oracle.code.samples.MathOptimizer
>
>
> More example to appear in this module.
Juan Fumero has updated the pull request incrementally with one additional commit since the last revision:
[samples] Example suite fixed with commets from PR#513
-------------
Changes:
- all: https://git.openjdk.org/babylon/pull/513/files
- new: https://git.openjdk.org/babylon/pull/513/files/49f5ef90..7ca5d4f8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=babylon&pr=513&range=01
- incr: https://webrevs.openjdk.org/?repo=babylon&pr=513&range=00-01
Stats: 7 lines in 1 file changed: 0 ins; 5 del; 2 mod
Patch: https://git.openjdk.org/babylon/pull/513.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/513/head:pull/513
PR: https://git.openjdk.org/babylon/pull/513
More information about the babylon-dev
mailing list