javalinuxgraalvmjvm-hotspot

How can I change JVM implementation (e.g. HotSpot, GraalVM, OpenJ9 e.t.c.) when running JVM-compatible programs (Java, Kotlin, Scala e.t.c.)?


I need to change JVM implementation to compare which one is more suitable for requirements I need to meet. How can I achieve this? Specifically on GNU/Linux or MacOS. Is there a way to set JVM implementation when running java program with java console command? Or maybe I need to change some lib file that contains JVM implementation? Help would be appreciated.


Solution

  • When you have multiple JVMs on your machine, you can simply qualify which one you want, when you execute the java command.

    At least the Oracle JVM on Windows works like that. I haven't tried on Linux, or with any of the others, but the JVM doesn't need to be on the PATH, you can just qualify which one you want.

    See my answer to another question for examples of how that works.