I tried enabling assertions for Java 8 in Eclipse Luna by doing what most answers on here suggest, adding -ea as a VM argument in the Run config, as well as in the default VM arguments in the JRE config. Still I get the same error as before:
Multiple markers at this line - 'assert' should not be used as an identifier, since it is a reserved keyword from source level 1.4 on - Syntax error on token "assert", ( expected - Syntax error, insert "AssignmentOperator Expression" to complete Expression - Syntax error, insert ")" to complete Expression
My program is really just a simple program to try it out:
public class Test {
public static void main (String[] args) {
int x = 10;
assert x != 0 : "Test";
System.out.println(x);
}
}
What am I doing wrong?
I thought I anwer my own question, since the solution was hidden in a comment until now:
Removing -ea from the default parameters, but keeping it in the run configuration solved the problem, for me.