📄 e104. enabling assertions from the command line.txt
字号:
The command line options -ea and -da allow you to enable and disable assertion in a package subtree or in a class. Here are several examples of the switches. Enable assertions in all non-system classes:
java -ea MyApp
Enable assertions in all classes in the unnamed package:
java -ea:... MyApp
Enable assertions in all classes in a package subtree:
java -ea:com.mycompany... MyApp
Enable assertions in a particular class:
java -ea:com.mycompany.MyCompany MyApp
Disable assertions in all classes in a package subtree:
java -da:com.mycompany... MyApp
Disable assertions in a particular class:
java -da:com.mycompany.MyClass MyApp
Multiple assertion switches on the command line are processed from left to right. Enable assertions in all classes in a package subtree except for one class:
java -ea:com.mycompany... -da:com.mycompany.MyClass MyApp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -