I created a class TestAssertion.java When i run using java -ea TestAssertion it runs fine, but if I write java -ea:TestAssertion the programs does not run. Why? The colon does not seem to work. Can somebody please explain what I am missing.
-ea[:<package name>"..." | :<class name> ] Enable assertions. Assertions are disabled by default.
With no arguments, enableassertions or -ea enables assertions. With one argument ending in "...", the switch enables assertions in the specified package and any subpackages. If the argument is simply "...", the switch enables assertions in the unnamed package in the current working directory. With one argument not ending in "...", the switch enables assertions in the specified class.
So your example usage should probably be: java -ea:TestAssertion TestAssertion