Quick Reference

Run Applications Enable Polyglot Programming Java application Compile a Java class: Run a Node.js application: javac MyApp.java node myApp.js Run the application from a JAR file: Run a JavaScript, , Ruby, Python, LLVM application: Java Build Tool java -jar MyApp.jar js myApp.js mvn package / gradle build Specify the class path for the app: graalpython myApp.py java -cp target/myapp.jar ruby myApp.rb com.mycompany.app.MyApp R myApp.r Native Image Builder Run the JIT compiler as JAR or native library (default): lli myApp native-image -jar App.jar -XX:±UseJVMCINativeLibrary Run other languages in a Java application:

Select the GraalVM compiler configuration: org.. graalvm polyglot -Dgraal.CompilerConfiguration= JIT AOT .Context enterprise|community|economy java -jar App.jar ./app .createContext() Print the details for the JIT compiled code: .eval("languageId", "code"); -Dgraal.PrintCompilation=true Produce the diagnostic data for the compilation: Build a shared library: Enable polyglot capabilities for an application: -Dgraal.Dump --shared --polyglot --jvm Load a javaagent: Build a statically linked native image: Limit resources for the application: -javaagent:[=] --static --libc=glibc|musl --sandbox.MaxCPUTime= -agentlib:[=] Include a language runtime in the native image: --sandbox.MaxStatements=N --language:js|python|ruby||wasm Debug the application: Compile to Native Executables Use profile-guided optimizations: --inspect[=[host:]] native-image --pgo-instrument MyApp --inspect-brk Install the native image builder from a local file: ./myapp #and apply load gu install -L native-image.jar Profile the application: native-image --pgo profile.iprof MyApp --cpusampler Native Image command syntax: Attach a debugger: --cputracer native-image [options] MyClass --debug-attach=[port] --memtracer Build a native image of a JAR file: Trace classes initialization: native-image -jar MyApp.jar --trace-class-initialization Run a native image: List all image build options for experts: ./myapp --expert-options-all

https//: www.graalvm.org ver: 1.000