Java / GraalVM Interview questions
How do you set GraalVM as your default JDK?
On most systems this is a matter of pointing JAVA_HOME and your PATH at the GraalVM installation directory.
export JAVA_HOME=/path/to/graalvm-jdk-21 export PATH=$JAVA_HOME/bin:$PATH java -version
If you manage JDKs with SDKMAN, sdk default java 21.0.2-graalce does the same thing persistently across shells without manually editing your shell profile.
On macOS, GraalVM installs typically live under /Library/Java/JavaVirtualMachines/, and tools like /usr/libexec/java_home -V can help locate the exact path to export.
Once set, both plain java commands and the native-image executable (bundled in the same bin directory) become available on the command line.
More Related questions...