Enabling Assertion Checking For Program Execution

Assertion checking is available only if you are running version 1.4 of the J2SE platform. By default, assertions are disabled. Assertion checking is available for the external executor, JAR executor, and debugger executor. Additional executors might be installed in your version of the IDE by extension modules.

To enable assertion checking for the external executor:

  1. From the main window, choose Tools and choose Options.
  2. In the Options window, expand Debugging and Executing and expand Execution Types.
  3. Select the External Execution node.
  4. On the Properties tab, set the Enable Asserts property to True.

To enable assertion checking for all other executors:

  1. From the main window, choose Tools and choose Options.
  2. In the Options window, expand Debugging and Executing and expand Execution Types.
  3. Select the desired Execution node.
  4. On the Properties tab, find the External Process property, click its value, and click the ellipsis (...) button.
  5. In the property editor, find the Arguments field and insert -ea in front of the list of command-line switches.
Tip You can enable assertions with various granularities. For more information, see
http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html
See also
Working With Assertions
Switching JDKs

Legal Notices