- Go to the menu
Run
, and then to the menu itemRun Configurations
.
-
In the left panel, go to
Java Application
, and then go toAssertions
. -
In the right panel, choose the tab
Arguments
. -
Under the field for
VM arguments
, type-ea
to enable assertions.
- Click on the
Apply
and thenRun
button.
To globally set it as the default for everything:
-
Go to menu
Window
(if you are on Windows), or go to menuEclipse
(if you are on Mac). For Linux it might be something similar. -
Go to
Preferences
. -
Choose
Java
, and thenInstalled JREs
from the left panel. -
Select your JRE, and then click the
Edit...
button in the right panel. -
In the
Default VM arguments
field, add-ea
.