e104. enabling assertions from the command line.txt

来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 28 行

TXT
28
字号
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 + =
减小字号Ctrl + -
显示快捷键?