Enabling Assertion Checking for Program Execution

See Also 

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 External Execution, JAR Execution, and Debugger Execution. Additional execution types might be installed in your version of the IDE by extension modules.

To enable assertion checking for JAR Execution:

  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 type.
  4. Click the ellipsis (...) button for the External Process property, .
  5. In the property editor, type -ea in front of the list of command-line switches in the Arguments field.

To enable assertion checking for all other execution types:

  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. Set the Enable Asserts property to True.
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 JDK Versions

Legal Notices