</script><metaname="aes-config"content="pid=xux-opensource&user_type=101&uid=&username=&dim10=arthas"><scriptsrc="//g.alicdn.com/alilog/mlog/aplus_v2.js"id="beacon-aplus"exparams="clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx"></script><scriptsrc="//g.alicdn.com/aes/??tracker/1.0.34/index.js,tracker-plugin-pv/2.4.5/index.js,tracker-plugin-event/1.2.5/index.js,tracker-plugin-jserror/1.0.13/index.js,tracker-plugin-api/1.1.14/index.js,tracker-plugin-perf/1.1.8/index.js,tracker-plugin-eventTiming/1.0.4/index.js"></script><title>FAQ | arthas</title><metaname="description"content="arthas user document">
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><p>See more at <ahref="/en/doc/options.html"class="">options</a></p><divclass="custom-container tip"><pclass="custom-container-title">TIP</p><p>To support the jars appended by java.lang.instrument.Instrumentation#appendToBootstrapClassLoaderSearch need to enable unsafe.</p></div><h3id="how-to-view-the-result-in-json-format"tabindex="-1"><aclass="header-anchor"href="#how-to-view-the-result-in-json-format"aria-hidden="true">#</a> How to view the result in <code>json</code> format</h3><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>options json-format <spanclass="token boolean">true</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><p>See more at <ahref="/en/doc/options.html"class="">options</a></p><h3id="can-arthas-trace-native-methods"tabindex="-1"><aclass="header-anchor"href="#can-arthas-trace-native-methods"aria-hidden="true">#</a> Can arthas trace native methods</h3><p>No.</p><h3id="can-arthas-view-the-value-of-a-variable-in-memory"tabindex="-1"><aclass="header-anchor"href="#can-arthas-view-the-value-of-a-variable-in-memory"aria-hidden="true">#</a> Can arthas view the value of a variable in memory?</h3><ol><li>You can use <ahref="/en/doc/vmtool.html"class=""><code>vmtool</code></a> command.</li><li>You can use some tricks to intercept the object with the <ahref="/en/doc/tt.html"class=""><code>tt</code></a> command, or fetch it from a static method.</li></ol><h3id="how-to-filter-method-with-the-same-name"tabindex="-1"><aclass="header-anchor"href="#how-to-filter-method-with-the-same-name"aria-hidden="true">#</a> How to filter method with the same name?</h3><p>You can used all variables in <ahref="/en/doc/advice-class.html"class="">fundamental fields in expressions</a> for the condition express to filter method with the same name, you can use the number of parameters <code>params.length ==1</code>,parameter type <code>params[0] instanceof java.lang.Integer</code>,return value type <code>returnObj instanceof java.util.List</code> and so on in one or more combinations as condition express.</p><p>You can use <code>-v</code> to view the condition express result <ahref="https://github.com/alibaba/arthas/issues/1348"target="_blank"rel="noopener noreferrer">https://github.com/alibaba/arthas/issues/1348<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></p><p>example <ahref="/en/doc/quick-start.html"class="">math-game</a></p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code><spanclass="token function">watch</span> demo.MathGame primeFactors <spanclass="token string">'{params,returnObj,throwExp}'</span><spanclass="token string">'params.length >0 && returnObj instanceof java.util.List'</span><spanclass="token parameter variable">-v</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="how-to-watch-or-trace-constructor"tabindex="-1"><aclass="header-anchor"href="#how-to-watch-or-trace-constructor"aria-hidden="true">#</a> How to watch or trace constructor?</h3><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code><spanclass="token function">watch</span> demo.MathGame <spanclass="token operator"><</span>init<spanclass="token operator">></span><spanclass="token string">'{params,returnObj,throwExp}'</span><spanclass="token parameter variable">-v</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="how-to-watch-or-trace-inner-classes"tabindex="-1"><aclass="header-anchor"href="#how-to-watch-or-trace-inner-classes"aria-hidden="true">#</a> How to watch or trace inner classes?</h3><p>In the JVM specification the name of inner classes is <code>OuterClass$InnerClass</code>.</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code><spanclass="token function">watch</span> OuterClass<spanclass="token variable">$InnerClass</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="does-it-support-watch-and-trace-lambda-classes"tabindex="-1"><aclass="header-anchor"href="#does-it-support-watch-and-trace-lambda-classes"aria-hidden="true">#</a> Does it support watch and trace lambda classes?</h3><p>For classes generated by lambda, will be skipped because the JVM itself does not allow enhancements to classes generated by lambda.</p><ul><li><ahref="https://github.com/alibaba/arthas/issues/1225"target="_blank"rel="noopener noreferrer">https://github.com/alibaba/arthas/issues/1225<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></li></ul><h3id="enter-unicode-characters"tabindex="-1"><aclass="header-anchor"href="#enter-unicode-characters"aria-hidden="true">#</a> Enter Unicode characters</h3><p>Convert Unicode characters to <code>\u</code> representation:</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>ognl <spanclass="token string">'@java.lang.System@out.println("Hello \u4e2d\u6587")'</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="java-lang-classformaterror-null-skywalking-arthas-compatible-use"tabindex="-1"><aclass="header-anchor"href="#java-lang-classformaterror-null-skywalking-arthas-compatible-use"aria-hidden="true">#</a> java.lang.ClassFormatError: null, skywalking arthas compatible use</h3><p>When error log appear <code>java.lang.ClassFormatError: null</code>, it is usually modified by other bytecode tools that are not compatible with arthas modified bytecode.</p><p>For example: use skywalking V8.1.0 below <ahref="https://github.com/alibaba/arthas/issues/1141"target="_blank"rel="noopener noreferrer">cannot trace, watch classes enhanced by skywalking agent<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>, V8.1.0 or above is compatible, refer to skywalking configuration for more details. <ahref="https://github.com/apache/skywalking/blob/master/docs/en/FAQ/Compatible-with-other-javaagent-bytecode-processing.md#"target="_blank"rel="noopener noreferrer">skywalking compatible with other javaagent bytecode processing<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>.</p><h4id="class-redefinition-failed-attempted-to-change-the-schema-add-remove-fields"tabindex="-1"><aclass="header-anchor"href="#class-redefinition-failed-attempted-to-change-the-schema-add-remove-fields"aria-hidden="true">#</a> class redefinition failed: attempted to change the schema (add/remove fields)</h4><p>Reference: <ahref="https://github.com/alibaba/arthas/issues/2165"target="_blank"rel="noopener noreferrer">https://github.com/alibaba/arthas/issues/2165<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></p><h3id="can-i-use-arthas-offline"tabindex="-1"><aclass="header-anchor"href="#can-i-use-arthas-offline"aria-hidden="true">#</a> Can I use arthas offline?</h3><p>Yes. Just download the full size package and unzip it, refer to: <ahref="/en/doc/download.html"class="">Download</a>.</p><h3id="how-to-use-the-specified-version-of-arthas-without-using-the-automatic-upgrade-version"tabindex="-1"><aclass="header-anchor"href="#how-to-use-the-specified-version-of-arthas-without-using-the-automatic-upgrade-version"aria-hidden="true">#</a> How to use the specified version of Arthas without using the automatic upgrade version?</h3><ol><li>When starting <code>as.sh</code>/<code>arthas-boot.jar</code>, you can specify it with the <code>--use-version</code> parameter.</li><li>Download the full package, unzip it, and cd to the arthas directory to start. In this case, the version in the current direct