</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><p>The classloader can be specified with the <code>-c</code> option:</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code><spanclass="token function">mc</span> -c 327a647b /tmp/Test.java
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><p>You can also specify the ClassLoader with the <code>--classLoaderClass</code> option:</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>$ <spanclass="token function">mc</span> --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader /tmp/UserController.java -d /tmp
Affect<spanclass="token punctuation">(</span>row-cnt:1<spanclass="token punctuation">)</span> cost <spanclass="token keyword">in</span><spanclass="token number">346</span> ms
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div></div></div><p>The output directory can be specified with the <code>-d</code> option:</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code><spanclass="token function">mc</span> -d /tmp/output /tmp/ClassA.java /tmp/ClassB.java
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><p>After compiling the <code>.class</code> file, you can use the <ahref="/en/doc/retransform.html"class="">retransform</a> command to re-define the loaded classes in JVM.</p><divclass="custom-container warning"><pclass="custom-container-title">WARNING</p><p>Note that the mc command may fail. If the compilation fails, the <code>.class</code> file can be compiled locally and uploaded to the server. Refer to the <ahref="/en/doc/retransform.html"class="">retransform</a> command description for details.</p></div></div><!--[--><!--]--></div><footerclass="page-meta"data-v-e0e60120><divclass="meta-item edit-link"><aclass="external-link meta-item-label"href="https://github.com/alibaba/arthas/edit/master/site/docs/en/doc/mc.md"rel="noopener noreferrer"target="_blank"aria-label="Edit this page on GitHub"><!--[--><!--]--><span>Edit this page on GitHub</span><span><svgclass="external-link-icon"xmlns="http://www.w3.org/2000/svg"aria-hidden="true"focusable="false"x="0px"y="0px"viewbox="0 0 100 100"width="15"height="15"><pathfill="currentColor"d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygonfill="currentColor"points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><spanclass="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><divclass="meta-item last-updated"><spanclass="meta-item-label">Last Updated: </span><!----></div><divclass="meta-item contributors"><spanclass="meta-item-label">Contributors: </span><spanclass="meta-item-info"><!--[--><!--[--><spanclass="contributor"title="email: hengyunabc@gmail.com">hengyunabc</span><!--[-->, <!--]--><!--]--><!--[--><spanclass="contributor"title="email: hollowman186@vip.qq.com">Hollow Man</span><!--[-->, <!--]--><!--]--><!--[--><spanclass="contributor"title="email: hollowman@hollowman.ml">Hollow Man</span><!--[-->, <!--]--><!--]--><!--[--><spanclass="contributor"title="email: snipercy@users.noreply.github.com">vic</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>