Enabling Java Assertions per default in Eclipse Runtime Configuration

Assertions are a way to check in your Java coding for certain assumptions, e.g.

assert(a==2);

Assertions are available as of Java 1.4 and it is necessary to activate them via the jvm flag -ea or -enableassertions

See Assertions in Java for Details.

If you want to always enable assertions in your run configuration in Eclipse you can set this as a default flag in your runtime configuration under Windows -> Preference

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, He is the primary author of vogella.com. With more than one million visitors per month this website is one of the central sources for Java, Eclipse and Android programming information.
This entry was posted in Eclipse. Bookmark the permalink.