@ -20,3 +20,5 @@ mc -d /tmp/output /tmp/ClassA.java /tmp/ClassB.java
```
After compiling the `.class` file, you can use the [redefine](redefine.md) 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 [redefine](redefine.md) command description for details.
The `mc` command may fail. You can modify the code locally, compile it, and upload it to the server. Some servers do not allow direct uploading files, you can use the `base64` command to bypass.
1. Convert the `.class` file to base64 first, then save it as result.txt
```bash
Base64 < Test.class > result.txt
```
2. Login the server, create and edit `result.txt`, copy the local content, paste and save
3. Restore `result.txt` on the server to `.class`
```
Base64 -d < result.txt > Test.class
```
4. Use the md5 command to verify that the `.class` files are consistent.
<p>After compiling the <ttclass="docutils literal">.class</tt> file, you can use the <aclass="reference internal"href="redefine.html"><spanclass="doc">redefine</span></a> command to re-define the loaded classes in JVM.</p>
<blockquote>
<div>Note that the mc command may fail. If the compilation fails, the <ttclass="docutils literal">.class</tt> file can be compiled locally and uploaded to the server. Refer to the <aclass="reference internal"href="redefine.html"><spanclass="doc">redefine</span></a> command description for details.</div></blockquote>
<liclass="toctree-l3"><aclass="reference internal"href="#use-with-the-jad-mc-command">Use with the jad/mc command</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#tips-for-uploading-class-files-to-the-server">Tips for uploading .class files to the server</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#restrictions-of-the-redefine-command">Restrictions of the redefine command</a></li>
<spanid="tips-for-uploading-class-files-to-the-server"></span><h2>Tips for uploading .class files to the server<aclass="headerlink"href="#tips-for-uploading-class-files-to-the-server"title="Permalink to this headline">¶</a></h2>
<p>The <ttclass="docutils literal">mc</tt> command may fail. You can modify the code locally, compile it, and upload it to the server. Some servers do not allow direct uploading files, you can use the <ttclass="docutils literal">base64</tt> command to bypass.</p>
<ol>
<li><pclass="first">Convert the <ttclass="docutils literal">.class</tt> file to base64 first, then save it as result.txt</p>
<spanid="restrictions-of-the-redefine-command"></span><h2>Restrictions of the redefine command<aclass="headerlink"href="#restrictions-of-the-redefine-command"title="Permalink to this headline">¶</a></h2>