java tool
# common
- javac
- javap
- java
# JShell
Using JShell, you can enter program elements one at a time, immediately see the result, and make adjustments as needed. link (opens new window)
jshell -v: start JShell in verbose mode/exit/help intro
jshell> /help intro
|
| intro
| =====
|
| 使用 jshell 工具可以执行 Java 代码,从而立即获取结果
| 您可以输入 Java 定义(变量、方法、类等等),例如:int x = 8
| 或 Java 表达式,例如:x + x
| 或 Java 语句或导入
| 这些小块的 Java 代码称为“片段”
|
| 这些 jshell 工具命令还可以让您了解和
| 控制您正在执行的操作,例如:/list
|
| 有关命令的列表,请执行:/help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# jmap
jmap -dump:format=b,file=<dumpfile.hprof> <pid>
# Simian
identifies duplication in source code. 检测重复代码. link (opens new window)
java -jar <jar> -hjava -jar <jar> "src/**.tsx" | tee -i repeat_code_simian.txtjava -jar <jar> -threshold=10 "**/*.java" | tee -i java_duplication_gt_10.log
上次更新: 2025/03/18, 17:22:01