You don't compile using the -ea flag, you run it using the -ea flag. The assertions are compiled into the code regardless of the flags.
Isn't there a way to tell NetBeans to run your code with assertions enabled?
As a side node, you do know that your code should work just the same with and without assertions enabled? You can't assume that somebody else will also have assertions enabled when he/she runs your code.