You need to package your java program in a JAR files.
Check the native-image-configure tool by command:
native-image-configure --help
java -agentlib:native-image-agent=trace-output=./trace-file.json -jar demo.jar
native-image-configure process-trace --output-dir=./graal/ ./trace-file.json
Then, you will find reflection_config.json
in the output directory: ./graal/
.
More detail: CONFIGURE.md, REFLECTION.md.