You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/_sources/mc.md.txt

24 lines
582 B
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

mc
===
> Memory Compiler/内存编译器,编译`.java`文件生成`.class`。
```bash
mc /tmp/Test.java
```
可以通过`-c`参数指定classloader
```bash
mc -c 327a647b /tmp/Test.java
```
可以通过`-d`命令指定输出目录:
```bash
mc -d /tmp/output /tmp/ClassA.java /tmp/ClassB.java
```
编译生成`.class`文件之后,可以结合[redefine](redefine.md)命令实现热更新代码。
> 注意mc命令有可能失败。如果编译失败可以在本地编译好`.class`文件,再上传到服务器。具体参考[redefine](redefine.md)命令说明。