I’m running Eclipse Galileo. How do I enable assertions in Eclipse?
As suggested by other sites, I’ve tried adding the arguments: -ea. I have also tried changing the compiler compliance level to 1.4. Neither of those suggestions worked.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Run, and then to the menu itemRun Configurations.In the left panel, go to
Java Application, and then go toAssertions.In the right panel, choose the tab
Arguments.Under the field for
VM arguments, type-eato enable assertions.Applyand thenRunbutton.To globally set it as the default for everything:
Go to menu
Window(if you are on Windows), or go to menuEclipse(if you are on Mac). For Linux it might be something similar.Go to
Preferences.Choose
Java, and thenInstalled JREsfrom the left panel.Select your JRE, and then click the
Edit...button in the right panel.In the
Default VM argumentsfield, add-ea.