2

How does DCEVM patch the JVM so that it can be started both in the normal mode and in XXaltjvm mode? What does it do to the regular libjvm.so/jvm.dll/libjvm.dylib?

From Installing DCEVM

Nfff3
  • 321
  • 8
  • 24

1 Answers1

6

DCEVM does not patch the original JVM.
It installs a different version of libjvm.so under $JDK_HOME/lib/dcevm

-XXaltjvm option is supported by the regular Java launcher out of the box. When specified, the launcher looks for libjvm.so in the alternate directory:

  • if -XXaltjvm value starts with /, it is treated as the absolute path of the alternative JVM;
  • otherwise, the directory is relative to the JDK home: $JDK_HOME/lib/<altjvm>
apangin
  • 92,924
  • 10
  • 193
  • 247
  • 2
    I was also interested in this question. Out of curiosity, do you know if it is possible to patch an existing JVM if it comes with debug symbols (so in theory we can replace C/C++ functions in the executable because we know where they are located and we know the version of the JVM)? How hard would it be to do this? Some functions don't change that much from one Java version to the other.... – Csa77 Feb 08 '21 at 12:53
  • @Csa77 This is technically possible, though I don't think this is a good idea. – apangin Feb 08 '21 at 13:27