wood burning stoves*
The moose likes IDEs, Version Control and other tools and the fly likes How to enable assertions in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to enable assertions in Eclipse" Watch "How to enable assertions in Eclipse" New topic
Author

How to enable assertions in Eclipse

John G Wright
Greenhorn

Joined: Oct 25, 2012
Posts: 18
Hi all !

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 ?

Thanks
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

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
Greenhorn

Joined: Oct 25, 2012
Posts: 18
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to enable assertions in Eclipse