- Latest (GraalVM for JDK 21)
- Dev Build
- GraalVM for JDK 21
- GraalVM for JDK 20
- GraalVM for JDK 17
- GraalVM 22.3
- GraalVM 22.2
- GraalVM 22.1
- GraalVM 22.0
- GraalVM 21.3
- Native Image
- Build Output
- Build Configuration
- Tracing Agent
- Experimental Agent Options
- Native Image Compatibility and Optimization Guide
- Class Initialization in Native Image
- Static Native Images
- Native Image Options
- Native Image Hosted and Runtime Options
- Native Image Inspection Tool
- Native Image C API
- Implementing Native Methods in Java with Native Image
- LLVM Backend for Native Image
- Debug Info Feature
- Points-to Analysis Reports
- Using System Properties in Native Image
- Profile-Guided Optimizations
- Memory Management at Image Run Time
- Generating Heap Dumps from Native Images
- JDK Flight Recorder with Native Image
- JCA Security Services on Native Image
- Dynamic Proxy on Native Image
- Java Native Interface (JNI) on Native Image
- Reflection on Native Image
- Accessing Resources in Native Images
- Logging on Native Image
- URL Protocols on Native Image
- Native Image ARM64 Support
- GraalVM Updater
- Languages References
- Embedding Reference
- Polyglot Programming
Note
This documentation may be out of date. See the latest version.
Native Image Inspection Tool
Native Image Enterprise Edition comes with a tool outputting the list of methods included in a given executable or shared library compiled with GraalVM Native Image.
The tool is accessible through $GRAALVM_HOME/bin/native-image-inspect <path_to_binary>
and outputs this list as a JSON array in the following format:
$GRAALVM_HOME/bin/native-image-inspect helloworld
{
"methods": [
{
"declaringClass": "java.lang.Object",
"name": "equals",
"paramTypes": [
"java.lang.Object"
]
},
{
"declaringClass": "java.lang.Object",
"name": "toString",
"paramTypes": []
},
...
]
}
The Native Image compilation process, by default, includes metadata in the executable allowing the inspection tool to emit the list of included methods.
The amount of data included is fairly minimal compared to the overall image size, however users can set the -H:-IncludeMethodsData
option to disable the metadata emission.
Images compiled with this option will not be able to be inspected by the tool.
Evolution #
The tool is continuously being improved upon. Envisioned new features include:
- Outputting the list of classes and fields included in the image alongside the methods.
- Windows support