【Eclipse】开启断言 assert

步骤:

  1. Window->Preferences->Java->Installed JREs->Edit
  2. Edit JRE->Default VM arguments->输入 -ea
    (ea:enable assertions)


    【Eclipse】开启断言 assert_第1张图片
    eclipse开启assert -step1
【Eclipse】开启断言 assert_第2张图片
eclipse开启assert -step2
【Eclipse】开启断言 assert_第3张图片
eclipse开启assert -step3

Eclipse: enable assertions
To globally set it as the default for everything:

  1. Go to menu Window (if you are on Windows), or go to menu Eclipse (if you are on Mac). For Linux it might be something similar.
  2. Go to Preferences.
  3. Choose Java, and then Installed JREs from the left panel.
  4. Select your JRE, and then click the Edit... button in the right panel.
  5. In the Default VM arguments field, add -ea.

你可能感兴趣的:(【Eclipse】开启断言 assert)