• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to enable assertions in Eclipse

 
John G Wright
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 924
1
Fedora Java Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!