How can I enable the assert
keyword in Eclipse?
public class A
{
public static void main(String ... args)
{
System.out.println(1
Java introduced the assert
keyword, so the way to enable source-level support is to make sure that Eclipse's Java compliance level is 1.4 or higher. (The chances are that the compliance level is already higher than that ...)
To cause a Java application launched from Eclipsed to run with assertion checking enabled, add the "-ea" argument to the VM arguments in the launcher configuration's "Arguments" tab.