I compile and run using Ctrl + F11. But in case of assertions, how to enable assertions at run time in Eclipse ? I can get the output for enabling assertions at command prompt. How to do the same in eclipse ?
in case of eclipse you have to right click your project or file and then select Run as > Run configurations. in the opened menu , select Arguments tab. then there will be option VM ARGUMENT. there you have to supply the switch for enabling the assertions. you can do -ea and check it out. hope this helps
John G Wright
Joined: Oct 25, 2012
Thanks for the reply and it helped a lot. I was trying the same in program arguments and that's the reason I was not getting any assertion errors.