This week's book giveaway is in the Java 9 forum. We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line! See this thread for details.
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
posted 5 years ago
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.