* [reset](reset.md) - reset all the enhanced classes. All enhanced classes will also be reset when Arthas server is closed by `shutdown`
* version - print the version for the Arthas attached to the current Java process
@ -27,9 +29,10 @@ Advanced Usage
* [sc](sc.md) - check the info for the classes loaded by JVM
* [sm](sm.md) - check methods info for the loaded classes
* [dump](dump.md) - dump the loaded classes in byte code to the specified location
* [redefine](redefine.md) - load external `*.class` files and re-define it into JVM
* [jad](jad.md) - decompile the specified loaded classes
* [mc](mc.md) - Memory compiler, compiles `.java` files into `.class` files in memory
* [redefine](redefine.md) - load external `*.class` files and re-define it into JVM
* [dump](dump.md) - dump the loaded classes in byte code to the specified location
* [classloader](classloader.md) - check the inheritance structure, urls, class loading info for the specified class; using classloader to get the url of the resource e.g. `java/lang/String.class`
By default, the decompile result will have the `ClassLoader` information. With the `--source-only` option, you can print only the source code. Conveniently used with the [mc](mc.md)/[redefine](redefine.md) commands.
<li><aclass="reference internal"href="cat.html"><spanclass="doc">cat</span></a> - Concatenate and print files</li>
<li><aclass="reference internal"href="pwd.html"><spanclass="doc">pwd</span></a> - Return working directory name</li>
<li>session - display current session information</li>
<li><aclass="reference internal"href="reset.html"><spanclass="doc">reset</span></a> - reset all the enhanced classes. All enhanced classes will also be reset when Arthas server is closed by <ttclass="docutils literal">shutdown</tt></li>
<li>version - print the version for the Arthas attached to the current Java process</li>
@ -220,9 +222,10 @@
<ulclass="simple">
<li><aclass="reference internal"href="sc.html"><spanclass="doc">sc</span></a> - check the info for the classes loaded by JVM</li>
<li><aclass="reference internal"href="sm.html"><spanclass="doc">sm</span></a> - check methods info for the loaded classes</li>
<li><aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a> - dump the loaded classes in byte code to the specified location</li>
<li><aclass="reference internal"href="redefine.html"><spanclass="doc">redefine</span></a> - load external <ttclass="docutils literal">*.class</tt> files and re-define it into JVM</li>
<li><aclass="reference internal"href="jad.html"><spanclass="doc">jad</span></a> - decompile the specified loaded classes</li>
<li><aclass="reference internal"href="mc.html"><spanclass="doc">mc</span></a> - Memory compiler, compiles <ttclass="docutils literal">.java</tt> files into <ttclass="docutils literal">.class</tt> files in memory</li>
<li><aclass="reference internal"href="redefine.html"><spanclass="doc">redefine</span></a> - load external <ttclass="docutils literal">*.class</tt> files and re-define it into JVM</li>
<li><aclass="reference internal"href="dump.html"><spanclass="doc">dump</span></a> - dump the loaded classes in byte code to the specified location</li>
<li><aclass="reference internal"href="classloader.html"><spanclass="doc">classloader</span></a> - check the inheritance structure, urls, class loading info for the specified class; using classloader to get the url of the resource e.g. <ttclass="docutils literal">java/lang/String.class</tt></li>
</ul>
</div>
@ -352,7 +355,7 @@
</script>
<divclass="github-fork-ribbon-wrapper right">
<divclass="github-fork-ribbon">
<ahref="https://github.com/alibaba/arthas">Fork me at GitHub</a>
<ahref="https://github.com/alibaba/arthas"target="_blank">Fork me at GitHub</a>
<liclass="toctree-l4"><aclass="reference internal"href="#decompile-the-specified-method">Decompile the specified method</a></li>
<liclass="toctree-l4"><aclass="reference internal"href="#decompile-with-specified-classloader">Decompile with specified classLoader</a></li>
</ul>
@ -271,6 +272,28 @@ CharSequence {
</pre></div>
</div>
</div>
<divclass="section"id="print-source-only">
<spanid="print-source-only"></span><h3>Print source only<aclass="headerlink"href="#print-source-only"title="Permalink to this headline">¶</a></h3>
<p>By default, the decompile result will have the <ttclass="docutils literal">ClassLoader</tt> information. With the <ttclass="docutils literal">--source-only</tt> option, you can print only the source code. Conveniently used with the <aclass="reference internal"href="mc.html"><spanclass="doc">mc</span></a>/<aclass="reference internal"href="redefine.html"><spanclass="doc">redefine</span></a> commands.</p>
<spanid="decompile-the-specified-method"></span><h3>Decompile the specified method<aclass="headerlink"href="#decompile-the-specified-method"title="Permalink to this headline">¶</a></h3>
<divclass="highlight-java notranslate"><divclass="highlight hljs"><preclass="java">$ jad demo.MathGame main
@ -406,7 +429,7 @@ Affect(row-cnt:1) cost in 190 ms.
</script>
<divclass="github-fork-ribbon-wrapper right">
<divclass="github-fork-ribbon">
<ahref="https://github.com/alibaba/arthas">Fork me at GitHub</a>
<ahref="https://github.com/alibaba/arthas"target="_blank">Fork me at GitHub</a>
<div>Notes: Re-defined classes cannot be restored. There are chances that redefining may fail due to some reasons, for example: there’s new field introduced in the new version of the class, pls. refer to JDK’s documentation for the limitations.</div></blockquote>