mc-retransform online tutorial

Memory compiler, compiles .java files into .class files in memory.

mc /tmp/

The classloader can be specified with the -c option:

mc -c 327a647b /tmp/

You can also specify the ClassLoader with the --classLoaderClass option:

$ mc --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader /tmp/ -d /tmp
Memory compiler output:
Affect(row-cnt:1) cost in 346 ms

The output directory can be specified with the -d option:

mc -d /tmp/output /tmp/ /tmp/

After compiling the .class file, you can use the retransform command to re-define the loaded classes in JVM.

Note that the mc command may fail. If the compilation fails, the .class file can be compiled locally and uploaded to the server. Refer to the retransform command description for details.